简体   繁体   中英

java path issue

I wanted to run a jar with the following command.

java -jar test.jar

What I need to add to the command so that I can get jre path info which it will be running against. ANd also How can I force above jar to run against particilar jvm.

Please help.

  1. To find out current JVM, run "java -version", or "java", or "java --help", etc. The first one will usually output version information. If you want to know the exact location of the java executable that you are using, then it's dependent on your OS. On linux, you could use the whereis program. ie "whereis java"

  2. To switch VMs, you specify a different path. "java" is nothing more than an executable program. So either set your OS's environment path, or reference the path absolutely. ie "c:\\MyJavaInstall\\jre\\java.exe -jar test.jar".

If this doesn't help you, then you need to elaborate on your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM