Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the name of running Java VM?

Tags:

java

jvm

How can I find the name of currently running java virtual machine name? I want to get it from java API.

Thanks

like image 941
Shamim Ahmmed Avatar asked Oct 03 '13 17:10

Shamim Ahmmed


1 Answers

Since you didn't really specify what you are looking for, take a look at these System Properties:

  • "java.vm.name"
  • "java.home"
  • "java.version"
  • "java.vendor"
  • "java.specification.vendor"

Like this:

System.out.println(System.getProperty("java.vm.name"));
System.out.println(System.getProperty("java.home"));
System.out.println(System.getProperty("java.vendor"));
System.out.println(System.getProperty("java.version"));
System.out.println(System.getProperty("java.specification.vendor"));
like image 75
Martijn Courteaux Avatar answered Sep 21 '22 15:09

Martijn Courteaux