java.lang.IllegalStateException in getSavedProperty when properties is empty
david.holmes at oracle.com
Fri Sep 9 03:36:34 UTC 2016
On 9/09/2016 3:40 AM, Max Schulze wrote:
> I am trying to implement my own virtual machine and making use of the
> rt.jar .
Difficult, because rt.jar is not a stand-alone implementation that can
be mixed-and-matched with arbitrary VMs. The initialization sequence is
very intricate and delicate and tightly coupled between the VM and the
core classes involved. The Java classes know about specific VM entry
points, and the VM knows about specific Java classes and methods 9and
exactly what they do).
> I am following the language and vm specification and currently have not
> come across formalities that require implementation/prefill of
> When the IntegerCache is being initialized, it calls getSavedProperty
> which doesn't like savedProps.isEmpty() at all
> (jdk/src/share/classes/sun/misc/VM.java:255) and throws the exception
> 1) What are the minimal properties that have to be initialized for the
> runtime to be functioning? I found sun.misc.Version.init(), but is there
> any specification of what the bare minimum would be?
All of the properties specified as standard properties in the
System.getProperties() method are supposed to be pre-filled to comply
with the platform specification.
> 2) There is a function initializeSystemClass()
> (jdk/src/share/classes/java/lang/System.java:1152) that calls
> initProperties(props). This will be called by the JVM at
>> JavaCalls::call_static(&result, klass,
> Shouldn't it be part of the JVM Specification to call this
> initializeSystemClass on thread setup then, if at all it wants to be
> able to run the rt.jar?
No because this is just an implementation artifact of The OpenJDK
implementation of the Java platform specifications.
The initialization dance between the VM and library code is even more
intricate in JDK 9 with the new module system.
> PS : talking about 1.8.0_91
> (On a side-note, there is activity around moving sun.misc.VM to
> jdk.internal.misc for JEP 260/JDK9, but which doesn't change above
> mentioned problems)
More information about the core-libs-dev