We are currently considering using Netbeans to develop a Jython application and I am in the process of evaluating Netbeans' features.
It appears that creating a Jython application is trivial in Netbeans once the Python and Jython modules are installed. Yet I couldn't find a feature which would let we wrap my Jython app as a JAR file with all its dependencies. Is this possible with Netbeans or with some other IDE or do I need to do this kind of packaging by hand?
Have you tried jump
http://pypi.python.org/pypi/jump/0.9.7.4
jump Homepage
Features :
Distributing Jython applications into a single, independent JAR file.
Distributing Jython libraries into a single JAR file. [New in v0.9.5]
Distributing native Mac OS X application bundles, Windows .exe executables, WAR files for Python WSGI applications. [New in v0.9.5]
Distributing Java Only applications. [New in v0.9.6]
Creating build.xml file for ant. [New in v0.9.7]
Supporting Java source code and third-party JAR files.
Supporting Java Native Interface files for distributing JAR files. [New in v0.9.5]
Starting the created distribution from either Jython or Java code.
Including specified resource files in the final distribution. [New in v0.9.6]
Packaging only required Python packages into the final distribution automatically, which means you don't have to worry about using Python third-party libraries as long as they can be found in your sys.path.
Importing specified Python packages explicitly. [New in v0.9.5]
All Python modules included in the final distribution are compiled to $py.class files, which means your source code is not public.
Integrated easy use Jython factory. [New in v0.9.7]
Quick-start Guide
There is also a info in the jython-wiki (not jump related)
In brief:
Jar file: run jump jar --main-entry-point=file:main (where file is the name of the Python script file and main is the application's main method/entry point
WAR file: run jump war --main-entry-point=file:main --war-wsgi-handler=...
The various options available for jump can be shown by outputting help/usage information: run jump --help.
Related
What is the standard way of generating war file for a GWT project?
I am implementing a simple GWT project with Eclipse Mars. I am using GWT SDK 2.7.0 and Tomcat 7.0.67.
My current way of creating war file is that after 'Google -> GWT Compile' the project, cd to {wordspace}\myproject\war folder and then enter command 'jar -cvf myproject.war *'.
What's very strange is that from time to time, the UI result displayed on http://localhost:8080/myproject/ is far different from expected. It's even different from C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\myproject\entrypoint.html as I manually checked it. In contrast, the result of 'Run As -> Web Application (GWT Super Dev Mode)' is always OK and always identical to what I expect.
I have also tried other .war creation methods like 'Export -> Web -> WAR File' in Eclipse and the one on http://www.tutorialspoint.com/gwt/gwt_deploy_application.htm. The former always doesn't work, and the latter does not work better than 'jar -cvf myproject.war *'.
The questions are:
What's a more standard, more reliable way of WAR file creation for a GWT project, so that after copying and pasting a newly created war file to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps), the result on http://localhost:8080/myproject/ can be always fine, or always identical to that on http://127.0.0.1:8888/myproject.html after running this GWT project on Eclipse 'as Web Application (GWT Super Dev Mode)'? (the major question)
Are there any configuration mistakes I'm unaware of which make this (the web page results on GWT Super Dev Mode and on http://localhost:8080/myproject/ after deploying war file are incongruent) happen?
We have an ARM project comprised of dozens of C source and header files, built from CLI using a Makefile hierarchy (specific build options are given as make command line params). The dev environment is the ARM DS-5 toolset. I want to use the existing Eclipse based Workbench IDE to continue the development of the project.
By defining a new Workspace and creating a new C project in it, I can import the whole filesystem to the project to browse and edit the files. However, the IDE is not "aware" of the project structure.
Is there a way to automatically generate an IDE project based on the project's Makefile(s)?
Note that there are a few similar questions around here, but I could not find a discussion specific to DS-5, and it looks like some options from CDT are not available in DS-5.
I have a Java EE web application written in Eclipse and deployed on WebLogic.
When I deploy it from Eclipse (as a virtual application) it works fine. When I try to create an EAR file and deploy it from the WebLogic console I get a ClassNotFoundException.
What could be the reason?
How can I create an EAR file that will match the structure of the virtual application so it will work?
Usually this means a dependent library is not being deployed. This tends to be where Eclipse has a dependency which it fulfills as part of the internal build. When building it yourself, work out which libraries you need, and which are part of your application, and which are part of WebLogic. For your own libraries (ie those in the lib folders, or those that SHOULD be in the lib folder) make sure they are on the classpath. For external libraries, ie those WebLogic fulfills, make sure you have the appropriate schema descriptors setup to tell weblogic which libraries it needs to deploy with your application (typically things like JSF).
If you want proper control over the build, take a look at things like Ant. You basically tell it via xml what is needed, put it together, and it generates the Ear/Jar file for you (the Ear file containing all the dependencies as well, and/or with your descriptors for weblogic built in libraries).
If you are planning many builds, I find Ant useful once setup (you can tie it in with other programs too, so it can push a build to your Source Control Server as a tag, build documentation, etc). Ant can be a pain though- you need build descriptors for each library you need to build, as well as the Ear file.
I'm trying to produce a jar file of my project using Eclipse and when I try to use it it is giving me errors as certain files are not being included in the jar file. I recompiled the project again and after generating the jar file it states that "Jar file export finished with warnings" and certain files are exported with compile warnings.
Is there another way to generate a jar file ? I tried using netbeans but its not allowing me to import the project
You can check in the project properties for the dependencies that you're using in your project environment (Project -> Properties -> Java Build Path).
If all the necessary dependencies are not included in the JAR file that you're creating and also not available on the classpath of the target system, then such errors will occur.
You can either pack the required dependencies in your JAR or deploy them separately to your target system - which method you use really depends on whether the dependencies are 3rd party libraries (they should be deployed separately) or home-grown components that are part of the system itself (they should be packaged together).
What's the best way to create/generate a setup file (.EXE) for a web dynamic project from Eclipse ?
the project must be installed after installing tomcat & SqlCE silently, since it depends on them both to work
thanks
There are many custom exe packers are available on web.
Just google for some "jar to exe" or "setup maker" type things you would definitely find something.
Something like this.
Java has no support for exe files. Exe files are specific to Windows platform while Java is intented to be platform independent.
Eclipse for Java doesn't offer builtin facilities to generate exe files since they have absolutely nothing to do with Java. Java's way is an executabele JAR file. You could create an executabele JAR file wherein you do the installing job in a main() method. Once you have the main() method finished, Eclipse can autogenerate the JAR by the Runnable JAR wizard.
If you really want an exe file, you'd need to write a custom one using C++ or C# (at least, the same language as Windows is written in and natively supports). It should then do basically the same as what you would do in the Java's main() method.