tags:

views:

51

answers:

3

Hi,

I would like to see what command line executes Eclipse when launching my java program. How could I get that please ? (like for example java.exe -classpath "H:\Eclipse_workspace\Example1\bin;.... myClass.class)

Thanks

+1  A: 

You could use the RuntimeMXBean within the application that is launched by eclipse.

RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
List<String> paramList=new ArrayList<String>();
paramList.addAll( RuntimemxBean.getInputArguments() );
paramList.add(  RuntimemxBean.getClassPath() );
paramList.add(  RuntimemxBean.getBootClassPath()  );
paramList.add(  RuntimemxBean.getLibraryPath()  );

for( String p : paramList ) {
    System.out.println( p ); 
}
stacker
Thanks, it's working perfectly fine !
scsin75
A: 

Depending on what you're seeking and when, you might find it sufficient to view the run configuration, accessible via Run>Run Configurations. It identifies what JRE is being used, the program and VM arguments, the classpath, and more.

Andy Thomas-Cramer
A: 

If you're using a launch configuration, i.e. starting the programm your developing, you will get the command line from Eclipse itself. Switch to the Debug Perspective, right click on the virtual machine line in the Debug View (first or last node directly below your application) and choose Properties. Select Process Information and you will see the command line in all it's glory.

Achim Lörke
thanks, stupid question (just beginning with eclipse), where is the virtual machine line in the debug view ?
scsin75