0

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
  • 1
    If I read the question correctly, you are trying to find out the location of the default JVM and how to change it. If this is correct, the answer depends on your operating system. Please add this information, and try to make the question clearer and more specific. Commented Oct 21, 2010 at 17:43

1 Answer 1

4
  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. i.e. "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. i.e. "c:\MyJavaInstall\jre\java.exe -jar test.jar".

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.