OpenJDK-14.0.1
Introduction to OpenJDK
OpenJDK is an open-source
implementation of Oracle's Java Standard Edition platform.
OpenJDK is useful for developing
Java programs, and provides a
complete runtime environment to run Java programs.
This package is known to build and work properly using an LFS-10.0
platform.
OpenJDK is GPL'd code, with a special exception made for non-free
projects to use these classes in their proprietary products. In
similar fashion to the LGPL, which allows non-free programs to link
to libraries provided by free software, the GNU General Public
License, version 2, with the Classpath Exception allows third
party programs to use classes provided by free software without the
requirement that the third party software also be free. As with the
LGPL, any modifications made to the free software portions of a
third party application, must also be made freely available.
Note
The OpenJDK source includes a
very thorough, open source test suite using the JTreg test harness. The testing instructions
below allow to test the just built JDK for reasonable
compatibility with the proprietary Oracle JDK. However, in order
for an independent implementation to claim compatibility, it must
pass a proprietary JCK/TCK test
suite. No claims of compatibility, even partial compatibility,
may be made without passing an approved test suite.
Oracle does provide free community access, on a case by case
basis, to a closed toolkit to ensure 100% compatibility with its
proprietary JDK. Neither the binary version provided on the
Java-14.0.1 page nor the JVM built with the
instructions below have been tested against the
TCK. Any version that is built using the instructions given,
cannot claim to be compatible with the proprietary JDK, without
the user applying for, and completing the compatibility tests
themselves.
With that in mind, the binaries produced using this build method
are regularly tested against the TCK by the members listed on the
site above. In addition to the community license above, an
educational, non-commercial license for the TCK can be obtained
from here.
Package Information
Additional Downloads
Optional test harness
Required patch
OpenJDK Dependencies
Required Dependencies
An existing binary (Java-14.0.1 or an earlier built version of this
package. The instructions below assume that you are using Configuring the JAVA
environment), alsa-lib-1.2.3.2, cpio-2.13, Cups-2.3.3, UnZip-6.0, Which-2.21, Xorg Libraries, and
Zip-3.0
Recommended
make-ca-1.7, giflib-5.2.1, Little CMS-2.11, libjpeg-turbo-2.0.5, libpng-1.6.37, and
Wget-1.20.3
Optional
git-2.28.0,
Graphviz-2.44.1, Mercurial-5.5, an X
Window manager such as twm-1.0.11 (for the tests), and pandoc
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/openjdk
Installation of OpenJDK
If you have downloaded the optional test harness, unpack it now:
tar -xf ../jtreg-4.2-b13-517.tar.gz
Apply a patch to allow building with make-4.3:
patch -p1 -i ../openjdk-14.0.1-make_4.3_fix-1.patch
Fix an issue coming from a removed header in glibc-2.32:
sed -i /sysctl/d \
src/jdk.incubator.jpackage/unix/native/libapplauncher/PosixPlatform.cpp
Note
Before proceeding, you should ensure that your environment
PATH
variable contains the location of
the Java compiler used for bootstrapping OpenJDK. This is the only requirement for
the environment. Modern Java installations do not need
JAVA_HOME
and CLASSPATH
is not used here. Furthermore, OpenJDK
developers recommend to unset JAVA_HOME
.
The build system does not support the -j
switch in MAKEFLAGS
. See the command explanation for
--with-jobs=
and --with-test-jobs=
for more information on
customizing parallelization.
Configure and build the package with the following commands
(--with-milestone value can be modified to fit user preferences):
unset JAVA_HOME &&
bash configure --enable-unlimited-crypto \
--with-extra-cflags="$CFLAGS -fcommon" \
--disable-warnings-as-errors \
--with-stdc++lib=dynamic \
--with-giflib=system \
--with-jtreg=$PWD/jtreg \
--with-lcms=system \
--with-libjpeg=system \
--with-libpng=system \
--with-zlib=system \
--with-version-build="7" \
--with-version-pre="" \
--with-version-opt="" \
--with-cacerts-file=/etc/pki/tls/java/cacerts &&
make images
To test the results, you will need to execute the jtreg program.
You can set the number of concurrent tests by adding the -conc:<X>
value in the
below command (tests will run sequentially otherwise):
export JT_JAVA=$(echo $PWD/build/*/jdk) &&
jtreg/bin/jtreg -jdk:$JT_JAVA -automatic -ignore:quiet -v1 \
test/jdk:tier1 test/langtools:tier1 &&
unset JT_JAVA
For more control over the test suite, review the documentation
available in jtreg/doc/jtreg/usage.txt
. To review the results,
see the files JTreport/test_{jdk,langtools}/text/stats.txt
and
JTreport/test_{jdk,langtools}/text/summary.txt
.
You should expect to see around 40 failures and about the same
number of errors.
Install the package with the following commands as the root
user:
install -vdm755 /opt/jdk-14.0.1+7 &&
cp -Rv build/*/images/jdk/* /opt/jdk-14.0.1+7 &&
chown -R root:root /opt/jdk-14.0.1+7 &&
for s in 16 24 32 48; do
install -vDm644 src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png \
/usr/share/icons/hicolor/${s}x${s}/apps/java.png
done
Note
If you only wish to install the Java Runtime Environment, you can
substitute build/*/images/jre
in
the above cp
command.
There are now two OpenJDK SDKs
installed in /opt
. You should decide
on which one you would like to use as the default. Normally, you
would opt for the just installed OpenJDK. If so, do the following as the
root
user:
ln -v -nsf jdk-14.0.1+7 /opt/jdk
If desired, you may create .desktop files to add entries in the
menu for java and
jconsole. The needed
icons have already been installed. As the root
user:
mkdir -pv /usr/share/applications &&
cat > /usr/share/applications/openjdk-java.desktop << "EOF" &&
[Desktop Entry]
Name=OpenJDK Java 14.0.1 Runtime
Comment=OpenJDK Java 14.0.1 Runtime
Exec=/opt/jdk/bin/java -jar
Terminal=false
Type=Application
Icon=java
MimeType=application/x-java-archive;application/java-archive;application/x-jar;
NoDisplay=true
EOF
cat > /usr/share/applications/openjdk-jconsole.desktop << "EOF"
[Desktop Entry]
Name=OpenJDK Java 14.0.1 Console
Comment=OpenJDK Java 14.0.1 Console
Keywords=java;console;monitoring
Exec=/opt/jdk/bin/jconsole
Terminal=false
Type=Application
Icon=java
Categories=Application;System;
EOF
Command Explanations
bash configure...:
the top level configure
is a wrapper
around the autotools one. It is not executable and must be run
through bash.
--with-extra-cflags=-fcommon
: Allows
building with GCC 10.
--enable-unlimited-crypto
:
Because of limitations on the usage of cryptography in some
countries, there is the possibility to limit the size of encryption
keys and the use of some algorithms in a policy file. This switch
allows to ship a policy file with no restriction. It is the
responsibility of the user to ensure proper adherence to the law.
--disable-warnings-as-errors
: This
switch disables use of -Werror
in the
build.
--with-stdc++lib=dynamic
:
This switch forces the build system to link to libstdc++.so
(dynamic) instead of libstdc++.a
(static).
--with-jobs=<X>
: The -j
passed to make does not work with
make as invoked here. By default, the build system will use the
number of CPUs - 1.
--with-jtreg=$PWD/jtreg
:
This switch tells configure where to find jtreg. Omit if you have
not downloaded the optional test suite.
--with-{giflib,lcms,libjpeg,libpng,zlib}=system
:
These switches force the build system to use the system libraries
instead of the bundled versions.
--with-version-build
:
Currently, the build system does not include the build number in
the version string. It has to be specified here.
--with-version-pre
: This
switch allows you to prefix the version string with a custom
string.
--with-version-opt
: This
switch allows you to add an optional build description to the
version string.
--with-cacerts-file=/etc/pki/tls/java/cacerts
:
Specifies where to find a cacerts
file, /etc/pki/tls/java/
on a BLFS
system. Otherwise, an empty one is created. You can use the
/usr/sbin/make-ca
--force command to generate it, once you have
installed the Java binaries.
--with-boot-jdk
: This switch provides
the location of the temporary JDK.
It is normally not needed if java is found in the PATH
.
find ... -iname '*.diz'
-delete: This command removes redundant files.
Configuring
OpenJDK
Configuration Information
Normally, the JAVA environment has been configured after
installing the binary version, and can be used with the just
built package as well. Review Configuring the JAVA
environment in case you want to modify something.
To test if the man pages are correctly installed, issue
source /etc/profile
and man java to
display the respective man page.
Settting
up the JRE Certificate Authority Certificates (cacerts) file
If you have run the instructions on the make-ca-1.7
page, you only need to create a symlink in the default location
for the cacerts
file. As user
root
:
ln -sfv /etc/pki/tls/java/cacerts /opt/jdk/lib/security/cacerts
To check the installation, issue:
cd /opt/jdk
bin/keytool -list -cacerts
At the prompt Enter keystore
password:
, enter changeit
(the default) or just
press the “Enter” key. If the cacerts
file was installed correctly, you will
see a list of the certificates with related information for each
one. If not, you need to reinstall them.
Contents
Installed Programs:
jaotc, jar, jarsigner, java, javac,
javadoc, javap, jcmd, jconsole, jdb, jdeprscan, jdeps, jfr,
jhsdb, jimage, jinfo, jjs, jlink, jmap, jmod, jpackage, jps,
jrunscript, jshell, jstack, jstat, jstatd, keytool, rmic, rmid,
rmiregistry, and serialver
Installed Libraries:
/opt/jdk-14.0.1/lib/*
Installed Directory:
/opt/jdk-14.0.1
Short Descriptions
jaotc
|
is an “ahead-of-time” java class
compiler.
|
jar
|
combines multiple files into a single jar archive.
|
jarsigner
|
signs jar files and verifies the signatures and integrity
of a signed jar file.
|
java
|
launches a Java application by starting a Java runtime
environment, loading a specified class and invoking its
main method.
|
javac
|
reads class and interface definitions, written in the
Java programming language, and compiles them into
bytecode class files.
|
javadoc
|
parses the declarations and documentation comments in a
set of Java source files and produces a corresponding set
of HTML pages describing the classes, interfaces,
constructors, methods, and fields.
|
javap
|
disassembles a Java class file.
|
jcmd
|
is a utility to send diagnostic command requests to a
running Java Virtual Machine.
|
jconsole
|
is a graphical console tool to monitor and manage both
local and remote Java applications and virtual machines.
|
jdb
|
is a simple command-line debugger for Java classes.
|
jdeprscan
|
scans class or jar files for uses of deprecated API
elements.
|
jdeps
|
shows the package-level or class-level dependencies of
Java class files.
|
jfr
|
is a tool for working with “Flight
Recorder” files.
|
jhsdb
|
is a tool to analyze the content of a core dump from a
crashed Java Virtual Machine (JVM).
|
jimage
|
is used to list, extract, verify, or get information
about modules in jimage format.
|
jinfo
|
prints Java configuration information for a given Java
process, core file, or a remote debug server.
|
jjs
|
is a command-line tool used to invoke the Nashorn engine.
It can be used to interpret one or several script files,
or to run an interactive shell.
|
jlink
|
is used to assemble and optimize a set of modules and
their dependencies into a custom runtime image.
|
jmap
|
prints shared object memory maps or heap memory details
of a given process, core file, or a remote debug server.
|
jmod
|
creates JMOD files and lists the content of existing JMOD
files.
|
jpackage
|
generates java application packages and images.
|
jps
|
lists the instrumented JVMs on the target system.
|
jrunscript
|
is a command line script shell.
|
jshell
|
is an interactive tool for learning the Java programming
language and prototyping Java code.
|
jstack
|
prints Java stack traces of Java threads for a given Java
process, core file, or a remote debug server.
|
jstat
|
displays performance statistics for an instrumented JVM.
|
jstatd
|
is an RMI server application that monitors for the
creation and termination of instrumented JVMs.
|
keytool
|
is a key and certificate management utility.
|
rmic
|
generates stub and skeleton class files for remote
objects from the names of compiled Java classes that
contain remote object implementations.
|
rmid
|
starts the activation system daemon.
|
rmiregistry
|
creates and starts a remote object registry on the
specified port on the current host.
|
serialver
|
returns the serialVersionUID for one or more classes in a
form suitable for copying into an evolving class.
|
Last updated on 2020-08-21 01:40:48 -0700