Hello, I have to launch a remote application on my machine. I managed to do that with a small script that invokes the main method of the application I want to execute, but now I have the problem to launch this application with some options to java command (these options are about remote debugging with JDI ). I tried with System.setProperty(..) but it didn't fixed. In other words, what I would like to di is the following, if I could do it from command line: java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket myApp.jar (myApp.jar is on a remote host) while all that I'm able to do is java myApp.jar Of course I want to do it from my java code, not from command line. Thank you everybody
The "options" in this case are not command line options to the java program (which you would be able to get from the String parameter to main()), but are command line options to the JVM. You can't specify JVM options for a specific class - and as far as I know, so far there isn't a way to change JVM options from inside a JVM. You'll need to specify these options on the command line of whatever JVM is running this class.