September 2018
Intermediate to advanced
802 pages
19h 30m
English
We have, at some point, used the -source and -target options to create a java build. The -source option is used to indicate the version of Java language accepted by the compiler, and the -target option is used to indicate the version supported by the class files. Often, we forget to use the -source option and by default, javac compiles against the latest available Java version. Due to this, there are chances of newer APIs being used and as a result, the build doesn't run as expected on the target version.
To overcome the confusion of providing two different command-line options, a new command-line option, --release, was introduced in Java 9. This acts as a substitute to the -source, -target and -bootclasspath ...
Read now
Unlock full access