How do I determine the command string eclipse uses to launch my java program?
I've got a simple java program, socket, AWT and jUnit dependencies.
I've built it in eclipse and when I run/debug it from eclipse it works.
When I launch it from the command line I get an error saying
Exception in thread "main" java.lang.NoClassDefFoundError
I'm guessing it's due to not finding one of the required dependencies in the classpath.
Given that launching from eclipse works, Is there a way of determining what command line eclipse uses to launch the same program?
It looks like your classpath isn't set appropriately when you try to run via the command line. You can easily export the command Eclipse uses by doing this:
- Run your application and go to your Debug perspective
- In the process viewer, there should be an entry for the app you've just executed
- Right-click the row that mentions java.exe or javaw.exe
- Select Properties
- In the dialog that pops up you'll see the Command Line which includes all classpath entries and arguments