This may be a dumb question, but I'm having problems running a Java Application from the command line using java -jar myapp.jar
.
The same application runs perfectly inside eclipse when I use the menu to select "run as Java Application"
Can I somehow make eclipse show me in the console exactly what it's executing so I can replicate it via command line?
When you launch the app from Eclipse, go to the Debug Perspective and find the app in the Debug view. Right-click on the class name in the Debug tree (highlighted here in blue)
select Properties, and there you can see the command line that was used to launch the app.
Look in the run configurations (Run -> Run Configurations...) for the myapp Java Application run configuration.
The Main tab will show you the main class. This is the class you'll have to add to the command line, or specify when you build your runnable jar.
The Classpath tab will show you any other jars or class files that have to be specified on the class path when you build your jar.