ADVERTISEMENT
ADVERTISEMENT

Home » Java programming language

How to get the vendor name of running Java VM in Java?

Java java.vm.vendor property example: Here, we are going to learn how to get and print the vendor name of running Java VM in Java?
Submitted by IncludeHelp, on September 18, 2019

To get the vendor name of running VM (Virtual Machine) in Java, we use the getProperties() method, which is defined in System class, while calling the method, we need to pass the property name to get the vendor name of running Java VM.

The property to get the vendor name is: "java.vm.vendor"

The method call is: System.getProperties("java.vm.vendor");

Java code to get and print the vendor name of running Java VM

// Java program to demonstrate the example of 
// getProperties() method of System Class

import java.lang.*;
import java.util.Properties;

public class Main {
    public static void main(String[] args) {
        String vm_vendor_name = null;
        vm_vendor_name = System.getProperty("java.vm.vendor");
        System.out.println("Running Java vm vendor name is: " + vm_vendor_name);
    }
}

Output

Running Java vm vendor name is: "Oracle Corporation"
ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.