Skip to content

Conversation

@johanvos
Copy link
Contributor

@johanvos johanvos commented Jan 6, 2026

Create a new documentation, explaining where the bootclasspath is set to either a jimage or exploded modules


## Create the Java Virtual Machine (JVM)

The JVM is created by invoking JNI_CreateJavaVM. In the HelloWorld demo that is explained [here](helloworld.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/JNI_CreateJavaVM/JNI_CreateJavaVM

## Create the Java Virtual Machine (JVM)

The JVM is created by invoking JNI_CreateJavaVM. In the HelloWorld demo that is explained [here](helloworld.md)
this made done in the `main.c` file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... that is explained here this made done in the ..." has no sense.
Maybe:
"... that is explained here, this is done in the ..."

Inside the `create_vm` function, a call is done to `Arguments::init_system_properties()` which will invoke `os::init_system_properties_values()` which will invoke `os::set_boot_path`, which is defined in [runtime/os.cpp](https://github.com/openjdk/mobile/src/hotspot/share/runtime/os.cpp).
In this function, `Arguments::set_boot_class_path` will be invoked with the detected location of the modules.
The detection of the modules happens in 2 phases:
1. If there is a file located at `<JAVA_HOME>lib/modules`, that one is considered to be the jimage containing all boot modules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/<JAVA_HOME>lib/modules/<JAVA_HOME>/lib/modules (missing slash)

Copy link

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over all this looks good, I hope information about AoT gets added to the documentation soon as well 😁

Comment on lines +31 to +32
1. If there is a file located at `<JAVA_HOME>lib/modules`, that one is considered to be the jimage containing all boot modules.
2. Otherwise, if there is a directory at `<JAVA_HOME>/modules/java.base`, that one is set as the boot_class_path
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should clarify the difference between exploaded and non-exploaded modules, if we want this to be more begineer friendly, should be fine either way though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants