Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid "Sharing is only supported for boot loader classes because bootstrap classpath has been appended" warning during debug with Java 11?

People also ask

How do you fix Openjdk 64 Bit Server VM warning sharing is only supported for boot loader classes because bootstrap classpath has been appended?

I was getting an error of (Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended). I found, too, going into Setting and search for async and unchecking the Instrumenting agent box. Worked for me!

Why debug is not working in Intellij?

To solve this, simply remove the jar of the debugged module from all modules' dependencies in the Project Structure. If you do not know which modules have the debugged module jar as dependencies, you can use some tools (Eg. Sublime Text, bash, ...) to search for the module name which is stored in Intellij *.

How do I debug in Intellij?

Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.


I had this issue too after installing jdk-12.0.1_windows-x64_bin.zip when trying to use the debugger with IntelliJ IDEA. I was getting an error of (Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended). I found, too, going into Setting and search for async and unchecking the Instrumenting agent box. Worked for me! ASYNC settings


I had this issue after installing Java12 when trying to use the debugger with Intellij Idea. The solution that I found was to go into Setting and searching for async and unchecking the Instrumenting agent box.


You can ignore this warning. It just means that class data sharing is disabled for classes not loaded by the bootstrap class loader.

From Improve Launch Times […] With Application Class-Data Sharing:

The JVM loads some of the JDK classes with the bootstrap class loader and the rest with the system class loader, but includes all of them in its default archive. When IntelliJ executes your project, it tells the JVM to load some code with the bootstrap class loader by appending to that class path (second part of the message). Now, that means that the portion of the archive that contains classes loaded by the system class loader is potentially invalidated and so the JVM partially deactivates sharing (first part of the message).

You could disable class data sharing completely with -Xshare:off, but you would lose some performance.


For me, the issue occurred only when I ran in Docker, and when I used a java command line agent like the DataDog APM agent (-javaagent:/dd-java-agent.jar). When I ran in my JDK11 runtime environment (without the agent) I did not get the warnings.