I am trying to run a program using jolwith Java 9 but no luck.
I have the following dependency in pom.xml:
<dependency>
<groupId>org.openjdk.jol</groupId>
<artifactId>jol-core</artifactId>
<version>0.9</version>
</dependency>
The program is simple:
package org.example;
import org.openjdk.jol.vm.VM;
public class Example {
public static void main(String[] args) throws Throwable {
System.out.println(VM.current().details());
}
}
Module descriptor:
module java9 {
requires jol.core;
}
When I run the program from IDEA, I see the following output:
You may add this JAR as -javaagent manually, or supply -Djdk.attach.allowAttachSelf
I added -Djdk.attach.allowAttachSelf=trueVM arguments to IDEA, but that didn't help (all the same output).
PS I can successfully run the program from the class. However, I wonder how to start it from the path to the module.
source
share