java - How to detect running JDK -
Return to the OpenJDK and Oracle JDK Java version both on Linux OS How can I find out if running Java is openJDK or Oracle JDK?
Code:
System.out.println ("java.vendor:" + System.getProperty ("java.vendor")); System.out.println ("java.version:" + System.getProperty ("java.version")); System.out.println ("java.vendor.url:" + System.getProperty ("java.vendor.url")); Output:
Java. Seller: Oracle Corporation Java Version: 1.7.0_55 java.vendor.url: http://java.oracle com / There is a Java-version command for two JDKs:
Java version "1.7.0_55" OpenJDK Runtime Environment (RHL-2.4.7.1.L 6_5 -X86_64 u55-b13) OpenZK's 64-bit server VM (24.51-B3, composite mode creation) Java version "1.7.0_51 "Java (TM) SE Runtime Environment (Build 1.7.0_51-B13) Java Hotspot (TM) Server VM (Build 24.51-B3, Mixed Mode)
Try:
println (System.getPrope rty ("java.vm.name"));
Comments
Post a Comment