Tuesday, 7 August 2018

Jcmd: VM.unlock_commercial_features: unlock commercial features

By using ‘VM.unlock_commercial_features’ command, you can unlock the commercial features of jvm.

HelloWorld.java
public class HelloWorld {
 public static void main(String args[]) throws Exception {
  Thread t1 = new Thread() {
   public void run() {
    while (true) {
     try {
      Thread.sleep(5000);
     } catch (Exception e) {

     }
    }
   }
  };

  t1.start();
 }
}

Compile and run above application.

Open command prompt (or) terminal and execute the command jcmd.

C:\>jcmd
1296 HelloWorld
13220
1700 com.sample.app.App
16332 sun.tools.jcmd.JCmd



As you see the output, HelloWorld application is running with process id 1296.


Execute the command ‘jcmd {PROCESS_ID} VM.unlock_commercial_features’, to unlock the commercial features for the application running with this process id.

For example, jcmd 1296 VM.unlock_commercial_features unlock the commercial features for HelloWorld application.



C:\>jcmd 1296 VM.unlock_commercial_features
1296:
Commercial Features now unlocked.



Previous                                                 Next                                                 Home

No comments:

Post a Comment