Skip to content

Add OpenJDK internals doc#70

Open
johanvos wants to merge 1 commit into
openjdk-mobile:mainfrom
johanvos:69-openjdkinternals
Open

Add OpenJDK internals doc#70
johanvos wants to merge 1 commit into
openjdk-mobile:mainfrom
johanvos:69-openjdkinternals

Conversation

@johanvos

@johanvos johanvos commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

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

Comment thread docs/jdkinternals.md

## 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
Copy Markdown
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

Comment thread docs/jdkinternals.md
## 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
Copy Markdown
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 ..."

Comment thread docs/jdkinternals.md
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
Copy Markdown
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)

@KolbyML KolbyML left a comment

Copy link
Copy Markdown

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 thread docs/jdkinternals.md
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
Copy Markdown

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