harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject [classlib] Launcher fails to find properties location when bad -Djava.home is specified on the command line
Date Fri, 24 Nov 2006 22:31:28 GMT
Gregory Shimansky wrote:
> Probably Geir meant internal native VM value for java.home property. Java 
> program cannot change that. Even setting this property with -D command line 
> switch won't give any effect on drlvm because it will be overridden on the 
> initialization... and now that I've written it and tried to override 
> java.home on command line, drlvm crashed :(
> 
> The bug however seems to be in the launcher because it didn't set 
> org.apache.harmony.boot.class.path to any value, so the property is NULL. I'm 
> going to take a look (recompiling classlib with debug since it has no symbols 
> by default).

A short investigation shows that launcher parses -Djava.home passed on 
the command line. Later on while classlib is initialized the function 
readClassPathFromPropertiesFile calls properties_load with file name 
formed as ${java.home}/lib/boot/bootclasspath.properties. If this file 
is not found and properties_load, then no value is assigned to 
org.apache.harmony.boot.class.path.

I think this system is wrong. The launcher should not pay attention to 
java.home passed on the command line. The location should be found from 
the executable path probably. RI doesn't crash or fail its boot classes 
when I specify bad -Djava.home on the command line.

-- 
Gregory


Mime
View raw message