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?

Answers


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:

  1. Run your application and go to your Debug perspective
  2. In the process viewer, there should be an entry for the app you've just executed
  3. Right-click the row that mentions java.exe or javaw.exe
  4. Select Properties
  5. In the dialog that pops up you'll see the Command Line which includes all classpath entries and arguments

Need Your Help

What will this Foreign Key on my MySQL Database table do for me?

php mysql sql database foreign-keys

I am building a Project Management project with PHP and MySQL. I have decided to add a Forum type Discussion sections. I am planning for it to be just like your typical Forums but instead of diff...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.