From 6f839323a78805437ae98db9870056b46dc93db4 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 24 Oct 2010 11:49:12 -0600 Subject: [PATCH] use user-specified boot classpath exclusively when present --- src/classpath-avian.cpp | 2 +- src/classpath-openjdk.cpp | 2 ++ src/jnienv.cpp | 14 +++++++------- src/main.cpp | 9 --------- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/classpath-avian.cpp b/src/classpath-avian.cpp index 750f40bc16..13bbf44f41 100644 --- a/src/classpath-avian.cpp +++ b/src/classpath-avian.cpp @@ -95,7 +95,7 @@ class MyClasspath : public Classpath { virtual const char* bootClasspath() { - return ""; + return BOOT_CLASSPATH; } virtual void diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 7c76128444..0c13971f4a 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -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()); diff --git a/src/jnienv.cpp b/src/jnienv.cpp index 74bab29f5a..0e249d2aba 100644 --- a/src/jnienv.cpp +++ b/src/jnienv.cpp @@ -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); diff --git a/src/main.cpp b/src/main.cpp index 383e324a3c..38cc765a3a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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("-Davian.bootimage=" BOOT_IMAGE); #endif -#ifdef BOOT_CLASSPATH - vmArgs.options[optionIndex++].optionString - = const_cast("-Xbootclasspath:" BOOT_CLASSPATH); -#endif - #ifdef BOOT_LIBRARY vmArgs.options[optionIndex++].optionString = const_cast("-Davian.bootstrap=" BOOT_LIBRARY);