use user-specified boot classpath exclusively when present

This commit is contained in:
Joel Dice 2010-10-24 11:49:12 -06:00
parent ec6080fea6
commit 6f839323a7
4 changed files with 10 additions and 17 deletions

View File

@ -95,7 +95,7 @@ class MyClasspath : public Classpath {
virtual const char*
bootClasspath()
{
return "";
return BOOT_CLASSPATH;
}
virtual void

View File

@ -182,6 +182,8 @@ class MyClasspath : public Classpath {
sb.append('\0');
this->classpath = sb.pointer;
sb.append(BOOT_CLASSPATH);
sb.append(s->pathSeparator());
sb.append(javaHome);
sb.append("/lib/rt.jar");
sb.append(s->pathSeparator());

View File

@ -2245,7 +2245,7 @@ JNI_CreateJavaVM(Machine** m, Thread** t, void* args)
const char* classpath = 0;
const char* javaHome = AVIAN_JAVA_HOME;
const char* bootClasspathPrepend = "";
const char* bootClasspath = "";
const char* bootClasspath = 0;
const char* bootClasspathAppend = "";
const char* crashDumpDirectory = 0;
@ -2300,21 +2300,21 @@ JNI_CreateJavaVM(Machine** m, Thread** t, void* args)
System* s = makeSystem(crashDumpDirectory);
Heap* h = makeHeap(s, heapLimit);
Classpath* c = makeClasspath(s, h, javaHome);
const char* classpathBootClasspath = c->bootClasspath();
if (bootClasspath == 0) {
bootClasspath = c->bootClasspath();
}
unsigned bcppl = strlen(bootClasspathPrepend);
unsigned bcpl = strlen(bootClasspath);
unsigned cbcpl = strlen(classpathBootClasspath);
unsigned bcpal = strlen(bootClasspathAppend);
unsigned bootClasspathBufferSize = bcppl + bcpl + cbcpl + bcpal + 3;
unsigned bootClasspathBufferSize = bcppl + bcpl + bcpal + 3;
RUNTIME_ARRAY(char, bootClasspathBuffer, bootClasspathBufferSize);
char* bootClasspathPointer = RUNTIME_ARRAY_BODY(bootClasspathBuffer);
local::append(&bootClasspathPointer, bootClasspathPrepend, bcppl,
bcpl + cbcpl + bcpal ? PATH_SEPARATOR : 0);
bcpl + bcpal ? PATH_SEPARATOR : 0);
local::append(&bootClasspathPointer, bootClasspath, bcpl,
cbcpl + bcpal ? PATH_SEPARATOR : 0);
local::append(&bootClasspathPointer, classpathBootClasspath, cbcpl,
bcpal ? PATH_SEPARATOR : 0);
local::append(&bootClasspathPointer, bootClasspathAppend, bcpal, 0);

View File

@ -105,10 +105,6 @@ main(int ac, const char** av)
++ vmArgs.nOptions;
#endif
#ifdef BOOT_CLASSPATH
++ vmArgs.nOptions;
#endif
#ifdef BOOT_IMAGE
++ vmArgs.nOptions;
#endif
@ -127,11 +123,6 @@ main(int ac, const char** av)
= const_cast<char*>("-Davian.bootimage=" BOOT_IMAGE);
#endif
#ifdef BOOT_CLASSPATH
vmArgs.options[optionIndex++].optionString
= const_cast<char*>("-Xbootclasspath:" BOOT_CLASSPATH);
#endif
#ifdef BOOT_LIBRARY
vmArgs.options[optionIndex++].optionString
= const_cast<char*>("-Davian.bootstrap=" BOOT_LIBRARY);