views:

105

answers:

2

Say i have a java project setup in eclipse. i have all the thirdparty jar's and reading the resources etc set in the eclipse IDE. ie all the classpath etc are set through the IDE

Now if i want to launch my app from commandline.

Can i get some hints/ links where i can undersand the configuration settings that can be done in Unix / windows machine to launch the application.

Looking for runtime configuration settings.

Because in production environment there is no IDE involved?

Also How do i set classpath in the server say jboss?

+3  A: 

You can include the classpath and dependencies info in the Manifest of your application.

And in addition, you can consider ant if you want to be able to build your project on a machine without an IDE at all.

Is there any information that you specify in Eclipse and you need to use in your production env?

abahgat
Hi am looking more info on setting up the runtime environment for the project.
krisp
+1  A: 

Use Eclipse 3.5

Create a launch configuration by selecting your class containing the main method, and running it.

File -> Export -> Java -> Runnable Jar

Personally I like the "put libraries in a sub-folder" since that does not merge jars or use a custom classloader.

The generated jar file can be executed with "java -jar whatever.jar".

You can redo this easier by either generating an ant script or making the launch configuration a shared file. (Run -> Run configurations. Select launch configuration, Choose "Common" pane. Choose "Shared file" and select a place to put it.

Thorbjørn Ravn Andersen