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

Posted on 2009-12-29
Last Modified: 2013-12-15
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.
Question by:Sarge516
    LVL 40

    Expert Comment

    java -classpath ..\lib\jar1;..\lib\jar2 classname
    LVL 5

    Expert Comment

    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
    LVL 5

    Accepted Solution

    Use this small Test class to know the classpath eclipse is using.
    Run this from your project:
    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++)

    Open in new window


    Author Closing Comment

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

    LVL 5

    Expert Comment

    Thanks for the point and rating :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now