mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
use user-specified boot classpath exclusively when present
This commit is contained in:
parent
ec6080fea6
commit
6f839323a7
@ -95,7 +95,7 @@ class MyClasspath : public Classpath {
|
|||||||
virtual const char*
|
virtual const char*
|
||||||
bootClasspath()
|
bootClasspath()
|
||||||
{
|
{
|
||||||
return "";
|
return BOOT_CLASSPATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
|
@ -182,6 +182,8 @@ class MyClasspath : public Classpath {
|
|||||||
sb.append('\0');
|
sb.append('\0');
|
||||||
|
|
||||||
this->classpath = sb.pointer;
|
this->classpath = sb.pointer;
|
||||||
|
sb.append(BOOT_CLASSPATH);
|
||||||
|
sb.append(s->pathSeparator());
|
||||||
sb.append(javaHome);
|
sb.append(javaHome);
|
||||||
sb.append("/lib/rt.jar");
|
sb.append("/lib/rt.jar");
|
||||||
sb.append(s->pathSeparator());
|
sb.append(s->pathSeparator());
|
||||||
|
@ -2245,7 +2245,7 @@ JNI_CreateJavaVM(Machine** m, Thread** t, void* args)
|
|||||||
const char* classpath = 0;
|
const char* classpath = 0;
|
||||||
const char* javaHome = AVIAN_JAVA_HOME;
|
const char* javaHome = AVIAN_JAVA_HOME;
|
||||||
const char* bootClasspathPrepend = "";
|
const char* bootClasspathPrepend = "";
|
||||||
const char* bootClasspath = "";
|
const char* bootClasspath = 0;
|
||||||
const char* bootClasspathAppend = "";
|
const char* bootClasspathAppend = "";
|
||||||
const char* crashDumpDirectory = 0;
|
const char* crashDumpDirectory = 0;
|
||||||
|
|
||||||
@ -2300,21 +2300,21 @@ JNI_CreateJavaVM(Machine** m, Thread** t, void* args)
|
|||||||
System* s = makeSystem(crashDumpDirectory);
|
System* s = makeSystem(crashDumpDirectory);
|
||||||
Heap* h = makeHeap(s, heapLimit);
|
Heap* h = makeHeap(s, heapLimit);
|
||||||
Classpath* c = makeClasspath(s, h, javaHome);
|
Classpath* c = makeClasspath(s, h, javaHome);
|
||||||
const char* classpathBootClasspath = c->bootClasspath();
|
|
||||||
|
if (bootClasspath == 0) {
|
||||||
|
bootClasspath = c->bootClasspath();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned bcppl = strlen(bootClasspathPrepend);
|
unsigned bcppl = strlen(bootClasspathPrepend);
|
||||||
unsigned bcpl = strlen(bootClasspath);
|
unsigned bcpl = strlen(bootClasspath);
|
||||||
unsigned cbcpl = strlen(classpathBootClasspath);
|
|
||||||
unsigned bcpal = strlen(bootClasspathAppend);
|
unsigned bcpal = strlen(bootClasspathAppend);
|
||||||
|
|
||||||
unsigned bootClasspathBufferSize = bcppl + bcpl + cbcpl + bcpal + 3;
|
unsigned bootClasspathBufferSize = bcppl + bcpl + bcpal + 3;
|
||||||
RUNTIME_ARRAY(char, bootClasspathBuffer, bootClasspathBufferSize);
|
RUNTIME_ARRAY(char, bootClasspathBuffer, bootClasspathBufferSize);
|
||||||
char* bootClasspathPointer = RUNTIME_ARRAY_BODY(bootClasspathBuffer);
|
char* bootClasspathPointer = RUNTIME_ARRAY_BODY(bootClasspathBuffer);
|
||||||
local::append(&bootClasspathPointer, bootClasspathPrepend, bcppl,
|
local::append(&bootClasspathPointer, bootClasspathPrepend, bcppl,
|
||||||
bcpl + cbcpl + bcpal ? PATH_SEPARATOR : 0);
|
bcpl + bcpal ? PATH_SEPARATOR : 0);
|
||||||
local::append(&bootClasspathPointer, bootClasspath, bcpl,
|
local::append(&bootClasspathPointer, bootClasspath, bcpl,
|
||||||
cbcpl + bcpal ? PATH_SEPARATOR : 0);
|
|
||||||
local::append(&bootClasspathPointer, classpathBootClasspath, cbcpl,
|
|
||||||
bcpal ? PATH_SEPARATOR : 0);
|
bcpal ? PATH_SEPARATOR : 0);
|
||||||
local::append(&bootClasspathPointer, bootClasspathAppend, bcpal, 0);
|
local::append(&bootClasspathPointer, bootClasspathAppend, bcpal, 0);
|
||||||
|
|
||||||
|
@ -105,10 +105,6 @@ main(int ac, const char** av)
|
|||||||
++ vmArgs.nOptions;
|
++ vmArgs.nOptions;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOT_CLASSPATH
|
|
||||||
++ vmArgs.nOptions;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BOOT_IMAGE
|
#ifdef BOOT_IMAGE
|
||||||
++ vmArgs.nOptions;
|
++ vmArgs.nOptions;
|
||||||
#endif
|
#endif
|
||||||
@ -127,11 +123,6 @@ main(int ac, const char** av)
|
|||||||
= const_cast<char*>("-Davian.bootimage=" BOOT_IMAGE);
|
= const_cast<char*>("-Davian.bootimage=" BOOT_IMAGE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOT_CLASSPATH
|
|
||||||
vmArgs.options[optionIndex++].optionString
|
|
||||||
= const_cast<char*>("-Xbootclasspath:" BOOT_CLASSPATH);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BOOT_LIBRARY
|
#ifdef BOOT_LIBRARY
|
||||||
vmArgs.options[optionIndex++].optionString
|
vmArgs.options[optionIndex++].optionString
|
||||||
= const_cast<char*>("-Davian.bootstrap=" BOOT_LIBRARY);
|
= const_cast<char*>("-Davian.bootstrap=" BOOT_LIBRARY);
|
||||||
|
Loading…
Reference in New Issue
Block a user