Skip to content

Commit

Permalink
JDK8 OSX <arch> (=amd64) not defined
Browse files Browse the repository at this point in the history
Don't remove <arch> (=amd64) from j9libBuffer. JDK8 on OSX doesn't have
amd64 directory. Removing <arch> invalidates the directory path stored
in j9libBuffer. This prevents java.home system property to be properly
defined. Incorrect java.home system property leads to JVM initialization
error. Paths to JAR files are incorrect; thus, the JAR files can't be
loaded.

I am guessing that (J9VM_JAVA9_BUILD < 150) won't have amd64 directory
on OSX since JDK8 doesn't have one. Also, (J9VM_JAVA9_BUILD < 150) is no
longer supported.
 
Issue: #3327

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
  • Loading branch information
babsingh committed Oct 17, 2018
1 parent 8d06ec3 commit ff8036a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions runtime/j9vm/jvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,10 +1096,15 @@ preloadLibraries(void)
jrebinBuffer = jvmBufferCat(NULL, jvmBufferData(j9binBuffer));
}
j9libBuffer = jvmBufferCat(NULL, jvmBufferData(jrebinBuffer));
#if J9VM_JAVA9_BUILD < 150
#if !defined(OSX)
/* <arch> directory doesn't exist on OSX so j9libBuffer shouldn't
* be truncated on OSX for removing <arch>.
*/
#if (J9VM_JAVA9_BUILD < 150)
/* Remove <arch> */
truncatePath(jvmBufferData(j9libBuffer));
#endif /* J9VM_JAVA9_BUILD < 150 */
#endif /* (J9VM_JAVA9_BUILD < 150) */
#endif /* !defined(OSX) */
j9libvmBuffer = jvmBufferCat(NULL, jvmBufferData(j9binBuffer));
j9Buffer = jvmBufferCat(NULL, jvmBufferData(jrebinBuffer));
truncatePath(jvmBufferData(j9Buffer));
Expand Down

0 comments on commit ff8036a

Please sign in to comment.