• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

I need the java launcher command line that runs my program from eclipse 3.5. Where do I find that?

I know there are workarounds, but I need to find the command line string that eclipse generates to run my class.  I have numerous jars and I need to cut and paste that string into another application. I am looking for the command generated by eclipse, i.e java -cp .....

Running Eclipse 3.5 on Fedora 12.
0
Sarge516
Asked:
Sarge516
1 Solution
 
Gurvinder Pal SinghCommented:
java -classpath ..\lib\jar1;..\lib\jar2 classname
0
 
TomLunCommented:
Well, since this is on Fedora I'd use : as the separator between the parts in the classpath i.e.
  java -cp ../lib/jar1;../lib/jar2 fully-qualified-classname
0
 
gksinghietCommented:
Use this small Test class to know the classpath eclipse is using.
Run this from your project:
import java.net.URL;
import java.net.URLClassLoader;


public class ClasspathTest {

  /**
   * @param args
   */
  public static void main(String[] args) {
    //Get the System Classloader
    ClasspathTest test = new ClasspathTest();
    ClassLoader sysClassLoader = test.getClass().getClassLoader();

    //Get the URLs
    URL[] urls = ((URLClassLoader)sysClassLoader).getURLs();

    for(int i=0; i< urls.length; i++)
    {
        System.out.println(urls[i].getFile());
    }    

  }

Open in new window

0
 
Sarge516Author Commented:
I was trying to get what eclipse generates, but that might not be possible. This solution would work for what I need to do.

Thanks!
0
 
gksinghietCommented:
Thanks for the point and rating :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now