Setting bootclasspath for cross-compiling on Java 8. #745
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After compiling Myria binaries on my laptop with Java 8 installed, I got mysterious errors after deployment which turned out to be due to not setting the
-bootclasspath
option tojavac
. See this article for explanation: https://blogs.oracle.com/darcy/entry/how_to_cross_compile_for. To cross-compile correctly from a newer JDK version to an older one, it is not enough to set-source
and-target
options as we do currently; we also have to set the boot classpath (where thejavac
class loader looks for "bootstrap" libraries). With this change, to build Myria on a system with Java 8 installed, you must install JDK 7 and set theJAVA7_HOME
environment variable to the location of your JDK. On a Mac, this can be done properly by adding the following to your.zshenv
or.bashrc
:export JAVA7_HOME=$(/usr/libexec/java_home -v 1.7)