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
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
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 );
}
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.
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.