Introduction
This article will help give information to install Java in Linux Ubuntu 19.04 operating system. In other words, it will help with the right direction so that ‘java’ binary program is available in the machine. The ‘java’ binary program itself is very useful to execute any java applications or programs. The process for the Java installation consists of two parts. The first one is the preparation part and the latter one is the configuration part. Just follow the steps in all the sequences below :
Preparing for Java Installation in Linux Ubuntu 19.04
1. Download the Java Standard Development Kit (SDK) from the following link. Currently, it is available in the Oracle Technology Network in the Java SE download page. In this article context, choose the ‘.tar.gz’ format file.
2. After successfully downloading the Java SDK or Java SE to the local machine, extract the file using the following command in the command line interface :
tar -xvf file-installer-java.tar.gz
The following is the execution’s example for extracting the java file installer :
root@localhost:/opt# cd /home/user/Downloads/installer/ root@localhost:/home/user/Downloads/installer# tar -xvf jdk-13.0.1_linux-x64_bin.tar.gz jdk-13.0.1/bin/jaotc jdk-13.0.1/bin/jar jdk-13.0.1/bin/jarsigner jdk-13.0.1/bin/java jdk-13.0.1/bin/javac jdk-13.0.1/bin/javadoc jdk-13.0.1/bin/javap jdk-13.0.1/bin/jcmd jdk-13.0.1/bin/jconsole jdk-13.0.1/bin/jdb jdk-13.0.1/bin/jdeprscan jdk-13.0.1/bin/jdeps jdk-13.0.1/bin/jfr jdk-13.0.1/bin/jhsdb jdk-13.0.1/bin/jimage jdk-13.0.1/bin/jinfo jdk-13.0.1/bin/jjs jdk-13.0.1/bin/jlink jdk-13.0.1/bin/jmap jdk-13.0.1/bin/jmod jdk-13.0.1/bin/jps jdk-13.0.1/bin/jrunscript jdk-13.0.1/bin/jshell jdk-13.0.1/bin/jstack jdk-13.0.1/bin/jstat jdk-13.0.1/bin/jstatd jdk-13.0.1/bin/keytool jdk-13.0.1/bin/pack200 jdk-13.0.1/bin/rmic jdk-13.0.1/bin/rmid jdk-13.0.1/bin/rmiregistry jdk-13.0.1/bin/serialver jdk-13.0.1/bin/unpack200 jdk-13.0.1/conf/logging.properties jdk-13.0.1/conf/management/jmxremote.access jdk-13.0.1/conf/management/jmxremote.password.template jdk-13.0.1/conf/management/management.properties jdk-13.0.1/conf/net.properties jdk-13.0.1/conf/sdp/sdp.conf.template jdk-13.0.1/conf/security/java.policy jdk-13.0.1/conf/security/java.security jdk-13.0.1/conf/security/policy/README.txt jdk-13.0.1/conf/security/policy/limited/default_US_export.policy jdk-13.0.1/conf/security/policy/limited/default_local.policy jdk-13.0.1/conf/security/policy/limited/exempt_local.policy jdk-13.0.1/conf/security/policy/unlimited/default_US_export.policy jdk-13.0.1/conf/security/policy/unlimited/default_local.policy jdk-13.0.1/conf/sound.properties jdk-13.0.1/include/classfile_constants.h jdk-13.0.1/include/jawt.h jdk-13.0.1/include/jdwpTransport.h jdk-13.0.1/include/jni.h jdk-13.0.1/include/jvmti.h jdk-13.0.1/include/jvmticmlr.h jdk-13.0.1/include/linux/jawt_md.h jdk-13.0.1/include/linux/jni_md.h jdk-13.0.1/jmods/java.base.jmod jdk-13.0.1/jmods/java.compiler.jmod jdk-13.0.1/jmods/java.datatransfer.jmod jdk-13.0.1/jmods/java.desktop.jmod jdk-13.0.1/jmods/java.instrument.jmod jdk-13.0.1/jmods/java.logging.jmod jdk-13.0.1/jmods/java.management.jmod jdk-13.0.1/jmods/java.management.rmi.jmod jdk-13.0.1/jmods/java.naming.jmod jdk-13.0.1/jmods/java.net.http.jmod jdk-13.0.1/jmods/java.prefs.jmod jdk-13.0.1/jmods/java.rmi.jmod jdk-13.0.1/jmods/java.scripting.jmod jdk-13.0.1/jmods/java.se.jmod jdk-13.0.1/jmods/java.security.jgss.jmod jdk-13.0.1/jmods/java.security.sasl.jmod jdk-13.0.1/jmods/java.smartcardio.jmod jdk-13.0.1/jmods/java.sql.jmod jdk-13.0.1/jmods/java.sql.rowset.jmod jdk-13.0.1/jmods/java.transaction.xa.jmod jdk-13.0.1/jmods/java.xml.crypto.jmod jdk-13.0.1/jmods/java.xml.jmod jdk-13.0.1/jmods/jdk.accessibility.jmod jdk-13.0.1/jmods/jdk.aot.jmod jdk-13.0.1/jmods/jdk.attach.jmod jdk-13.0.1/jmods/jdk.charsets.jmod jdk-13.0.1/jmods/jdk.compiler.jmod jdk-13.0.1/jmods/jdk.crypto.cryptoki.jmod jdk-13.0.1/jmods/jdk.crypto.ec.jmod jdk-13.0.1/jmods/jdk.dynalink.jmod jdk-13.0.1/jmods/jdk.editpad.jmod jdk-13.0.1/jmods/jdk.hotspot.agent.jmod jdk-13.0.1/jmods/jdk.httpserver.jmod jdk-13.0.1/jmods/jdk.internal.ed.jmod jdk-13.0.1/jmods/jdk.internal.jvmstat.jmod jdk-13.0.1/jmods/jdk.internal.le.jmod jdk-13.0.1/jmods/jdk.internal.opt.jmod jdk-13.0.1/jmods/jdk.internal.vm.ci.jmod jdk-13.0.1/jmods/jdk.internal.vm.compiler.jmod jdk-13.0.1/jmods/jdk.internal.vm.compiler.management.jmod jdk-13.0.1/jmods/jdk.jartool.jmod jdk-13.0.1/jmods/jdk.javadoc.jmod jdk-13.0.1/jmods/jdk.jcmd.jmod jdk-13.0.1/jmods/jdk.jconsole.jmod jdk-13.0.1/jmods/jdk.jdeps.jmod jdk-13.0.1/jmods/jdk.jdi.jmod jdk-13.0.1/jmods/jdk.jdwp.agent.jmod jdk-13.0.1/jmods/jdk.jfr.jmod jdk-13.0.1/jmods/jdk.jlink.jmod jdk-13.0.1/jmods/jdk.jshell.jmod jdk-13.0.1/jmods/jdk.jsobject.jmod jdk-13.0.1/jmods/jdk.jstatd.jmod jdk-13.0.1/jmods/jdk.localedata.jmod jdk-13.0.1/jmods/jdk.management.agent.jmod jdk-13.0.1/jmods/jdk.management.jfr.jmod jdk-13.0.1/jmods/jdk.management.jmod jdk-13.0.1/jmods/jdk.naming.dns.jmod jdk-13.0.1/jmods/jdk.naming.rmi.jmod jdk-13.0.1/jmods/jdk.net.jmod jdk-13.0.1/jmods/jdk.pack.jmod jdk-13.0.1/jmods/jdk.rmic.jmod jdk-13.0.1/jmods/jdk.scripting.nashorn.jmod jdk-13.0.1/jmods/jdk.scripting.nashorn.shell.jmod jdk-13.0.1/jmods/jdk.sctp.jmod jdk-13.0.1/jmods/jdk.security.auth.jmod jdk-13.0.1/jmods/jdk.security.jgss.jmod jdk-13.0.1/jmods/jdk.unsupported.desktop.jmod jdk-13.0.1/jmods/jdk.unsupported.jmod jdk-13.0.1/jmods/jdk.xml.dom.jmod jdk-13.0.1/jmods/jdk.zipfs.jmod jdk-13.0.1/legal/java.base/COPYRIGHT jdk-13.0.1/legal/java.base/LICENSE jdk-13.0.1/legal/java.base/aes.md jdk-13.0.1/legal/java.base/asm.md jdk-13.0.1/legal/java.base/c-libutl.md jdk-13.0.1/legal/java.base/cldr.md jdk-13.0.1/legal/java.base/icu.md jdk-13.0.1/legal/java.base/public_suffix.md jdk-13.0.1/legal/java.base/unicode.md jdk-13.0.1/legal/java.compiler/COPYRIGHT jdk-13.0.1/legal/java.compiler/LICENSE jdk-13.0.1/legal/java.datatransfer/COPYRIGHT jdk-13.0.1/legal/java.datatransfer/LICENSE jdk-13.0.1/legal/java.desktop/COPYRIGHT jdk-13.0.1/legal/java.desktop/LICENSE jdk-13.0.1/legal/java.desktop/colorimaging.md jdk-13.0.1/legal/java.desktop/giflib.md jdk-13.0.1/legal/java.desktop/harfbuzz.md jdk-13.0.1/legal/java.desktop/jpeg.md jdk-13.0.1/legal/java.desktop/lcms.md jdk-13.0.1/legal/java.desktop/libpng.md jdk-13.0.1/legal/java.desktop/mesa3d.md jdk-13.0.1/legal/java.desktop/opengl.md jdk-13.0.1/legal/java.desktop/xwd.md jdk-13.0.1/legal/java.instrument/COPYRIGHT jdk-13.0.1/legal/java.instrument/LICENSE jdk-13.0.1/legal/java.logging/COPYRIGHT jdk-13.0.1/legal/java.logging/LICENSE jdk-13.0.1/legal/java.management.rmi/COPYRIGHT jdk-13.0.1/legal/java.management.rmi/LICENSE jdk-13.0.1/legal/java.management/COPYRIGHT jdk-13.0.1/legal/java.management/LICENSE jdk-13.0.1/legal/java.naming/COPYRIGHT jdk-13.0.1/legal/java.naming/LICENSE jdk-13.0.1/legal/java.net.http/COPYRIGHT jdk-13.0.1/legal/java.net.http/LICENSE jdk-13.0.1/legal/java.prefs/COPYRIGHT jdk-13.0.1/legal/java.prefs/LICENSE jdk-13.0.1/legal/java.rmi/COPYRIGHT jdk-13.0.1/legal/java.rmi/LICENSE jdk-13.0.1/legal/java.scripting/COPYRIGHT jdk-13.0.1/legal/java.scripting/LICENSE jdk-13.0.1/legal/java.se/COPYRIGHT jdk-13.0.1/legal/java.se/LICENSE jdk-13.0.1/legal/java.security.jgss/COPYRIGHT jdk-13.0.1/legal/java.security.jgss/LICENSE jdk-13.0.1/legal/java.security.sasl/COPYRIGHT jdk-13.0.1/legal/java.security.sasl/LICENSE jdk-13.0.1/legal/java.smartcardio/COPYRIGHT jdk-13.0.1/legal/java.smartcardio/LICENSE jdk-13.0.1/legal/java.smartcardio/pcsclite.md jdk-13.0.1/legal/java.sql.rowset/COPYRIGHT jdk-13.0.1/legal/java.sql.rowset/LICENSE jdk-13.0.1/legal/java.sql/COPYRIGHT jdk-13.0.1/legal/java.sql/LICENSE jdk-13.0.1/legal/java.transaction.xa/COPYRIGHT jdk-13.0.1/legal/java.transaction.xa/LICENSE jdk-13.0.1/legal/java.xml.crypto/COPYRIGHT jdk-13.0.1/legal/java.xml.crypto/LICENSE jdk-13.0.1/legal/java.xml.crypto/santuario.md jdk-13.0.1/legal/java.xml/COPYRIGHT jdk-13.0.1/legal/java.xml/LICENSE jdk-13.0.1/legal/java.xml/bcel.md jdk-13.0.1/legal/java.xml/dom.md jdk-13.0.1/legal/java.xml/jcup.md jdk-13.0.1/legal/java.xml/xalan.md jdk-13.0.1/legal/java.xml/xerces.md jdk-13.0.1/legal/jdk.accessibility/COPYRIGHT jdk-13.0.1/legal/jdk.accessibility/LICENSE jdk-13.0.1/legal/jdk.aot/COPYRIGHT jdk-13.0.1/legal/jdk.aot/LICENSE jdk-13.0.1/legal/jdk.attach/COPYRIGHT jdk-13.0.1/legal/jdk.attach/LICENSE jdk-13.0.1/legal/jdk.charsets/COPYRIGHT jdk-13.0.1/legal/jdk.charsets/LICENSE jdk-13.0.1/legal/jdk.compiler/COPYRIGHT jdk-13.0.1/legal/jdk.compiler/LICENSE jdk-13.0.1/legal/jdk.crypto.cryptoki/COPYRIGHT jdk-13.0.1/legal/jdk.crypto.cryptoki/LICENSE jdk-13.0.1/legal/jdk.crypto.cryptoki/pkcs11cryptotoken.md jdk-13.0.1/legal/jdk.crypto.cryptoki/pkcs11wrapper.md jdk-13.0.1/legal/jdk.crypto.ec/COPYRIGHT jdk-13.0.1/legal/jdk.crypto.ec/LICENSE jdk-13.0.1/legal/jdk.crypto.ec/ecc.md jdk-13.0.1/legal/jdk.dynalink/COPYRIGHT jdk-13.0.1/legal/jdk.dynalink/LICENSE jdk-13.0.1/legal/jdk.dynalink/dynalink.md jdk-13.0.1/legal/jdk.editpad/COPYRIGHT jdk-13.0.1/legal/jdk.editpad/LICENSE jdk-13.0.1/legal/jdk.hotspot.agent/COPYRIGHT jdk-13.0.1/legal/jdk.hotspot.agent/LICENSE jdk-13.0.1/legal/jdk.httpserver/COPYRIGHT jdk-13.0.1/legal/jdk.httpserver/LICENSE jdk-13.0.1/legal/jdk.internal.ed/COPYRIGHT jdk-13.0.1/legal/jdk.internal.ed/LICENSE jdk-13.0.1/legal/jdk.internal.jvmstat/COPYRIGHT jdk-13.0.1/legal/jdk.internal.jvmstat/LICENSE jdk-13.0.1/legal/jdk.internal.le/COPYRIGHT jdk-13.0.1/legal/jdk.internal.le/LICENSE jdk-13.0.1/legal/jdk.internal.le/jline.md jdk-13.0.1/legal/jdk.internal.opt/COPYRIGHT jdk-13.0.1/legal/jdk.internal.opt/LICENSE jdk-13.0.1/legal/jdk.internal.opt/jopt-simple.md jdk-13.0.1/legal/jdk.internal.vm.ci/COPYRIGHT jdk-13.0.1/legal/jdk.internal.vm.ci/LICENSE jdk-13.0.1/legal/jdk.internal.vm.compiler.management/COPYRIGHT jdk-13.0.1/legal/jdk.internal.vm.compiler.management/LICENSE jdk-13.0.1/legal/jdk.internal.vm.compiler/COPYRIGHT jdk-13.0.1/legal/jdk.internal.vm.compiler/LICENSE jdk-13.0.1/legal/jdk.jartool/COPYRIGHT jdk-13.0.1/legal/jdk.jartool/LICENSE jdk-13.0.1/legal/jdk.javadoc/COPYRIGHT jdk-13.0.1/legal/jdk.javadoc/LICENSE jdk-13.0.1/legal/jdk.javadoc/jquery.md jdk-13.0.1/legal/jdk.javadoc/jqueryUI.md jdk-13.0.1/legal/jdk.javadoc/jszip.md jdk-13.0.1/legal/jdk.jcmd/COPYRIGHT jdk-13.0.1/legal/jdk.jcmd/LICENSE jdk-13.0.1/legal/jdk.jconsole/COPYRIGHT jdk-13.0.1/legal/jdk.jconsole/LICENSE jdk-13.0.1/legal/jdk.jdeps/COPYRIGHT jdk-13.0.1/legal/jdk.jdeps/LICENSE jdk-13.0.1/legal/jdk.jdi/COPYRIGHT jdk-13.0.1/legal/jdk.jdi/LICENSE jdk-13.0.1/legal/jdk.jdwp.agent/COPYRIGHT jdk-13.0.1/legal/jdk.jdwp.agent/LICENSE jdk-13.0.1/legal/jdk.jfr/COPYRIGHT jdk-13.0.1/legal/jdk.jfr/LICENSE jdk-13.0.1/legal/jdk.jlink/COPYRIGHT jdk-13.0.1/legal/jdk.jlink/LICENSE jdk-13.0.1/legal/jdk.jshell/COPYRIGHT jdk-13.0.1/legal/jdk.jshell/LICENSE jdk-13.0.1/legal/jdk.jsobject/COPYRIGHT jdk-13.0.1/legal/jdk.jsobject/LICENSE jdk-13.0.1/legal/jdk.jstatd/COPYRIGHT jdk-13.0.1/legal/jdk.jstatd/LICENSE jdk-13.0.1/legal/jdk.localedata/COPYRIGHT jdk-13.0.1/legal/jdk.localedata/LICENSE jdk-13.0.1/legal/jdk.localedata/cldr.md jdk-13.0.1/legal/jdk.localedata/thaidict.md jdk-13.0.1/legal/jdk.management.agent/COPYRIGHT jdk-13.0.1/legal/jdk.management.agent/LICENSE jdk-13.0.1/legal/jdk.management.jfr/COPYRIGHT jdk-13.0.1/legal/jdk.management.jfr/LICENSE jdk-13.0.1/legal/jdk.management/COPYRIGHT jdk-13.0.1/legal/jdk.management/LICENSE jdk-13.0.1/legal/jdk.naming.dns/COPYRIGHT jdk-13.0.1/legal/jdk.naming.dns/LICENSE jdk-13.0.1/legal/jdk.naming.rmi/COPYRIGHT jdk-13.0.1/legal/jdk.naming.rmi/LICENSE jdk-13.0.1/legal/jdk.net/COPYRIGHT jdk-13.0.1/legal/jdk.net/LICENSE jdk-13.0.1/legal/jdk.pack/COPYRIGHT jdk-13.0.1/legal/jdk.pack/LICENSE jdk-13.0.1/legal/jdk.rmic/COPYRIGHT jdk-13.0.1/legal/jdk.rmic/LICENSE jdk-13.0.1/legal/jdk.scripting.nashorn.shell/COPYRIGHT jdk-13.0.1/legal/jdk.scripting.nashorn.shell/LICENSE jdk-13.0.1/legal/jdk.scripting.nashorn/COPYRIGHT jdk-13.0.1/legal/jdk.scripting.nashorn/LICENSE jdk-13.0.1/legal/jdk.scripting.nashorn/double-conversion.md jdk-13.0.1/legal/jdk.scripting.nashorn/joni.md jdk-13.0.1/legal/jdk.sctp/COPYRIGHT jdk-13.0.1/legal/jdk.sctp/LICENSE jdk-13.0.1/legal/jdk.security.auth/COPYRIGHT jdk-13.0.1/legal/jdk.security.auth/LICENSE jdk-13.0.1/legal/jdk.security.jgss/COPYRIGHT jdk-13.0.1/legal/jdk.security.jgss/LICENSE jdk-13.0.1/legal/jdk.unsupported.desktop/COPYRIGHT jdk-13.0.1/legal/jdk.unsupported.desktop/LICENSE jdk-13.0.1/legal/jdk.unsupported/COPYRIGHT jdk-13.0.1/legal/jdk.unsupported/LICENSE jdk-13.0.1/legal/jdk.xml.dom/COPYRIGHT jdk-13.0.1/legal/jdk.xml.dom/LICENSE jdk-13.0.1/legal/jdk.zipfs/COPYRIGHT jdk-13.0.1/legal/jdk.zipfs/LICENSE jdk-13.0.1/lib/classlist jdk-13.0.1/lib/ct.sym jdk-13.0.1/lib/jexec jdk-13.0.1/lib/jfr/default.jfc jdk-13.0.1/lib/jfr/profile.jfc jdk-13.0.1/lib/jrt-fs.jar jdk-13.0.1/lib/jspawnhelper jdk-13.0.1/lib/jvm.cfg jdk-13.0.1/lib/libattach.so jdk-13.0.1/lib/libawt.so jdk-13.0.1/lib/libawt_headless.so jdk-13.0.1/lib/libawt_xawt.so jdk-13.0.1/lib/libdt_socket.so jdk-13.0.1/lib/libextnet.so jdk-13.0.1/lib/libfontmanager.so jdk-13.0.1/lib/libinstrument.so jdk-13.0.1/lib/libj2gss.so jdk-13.0.1/lib/libj2pcsc.so jdk-13.0.1/lib/libj2pkcs11.so jdk-13.0.1/lib/libjaas.so jdk-13.0.1/lib/libjava.so jdk-13.0.1/lib/libjavajpeg.so jdk-13.0.1/lib/libjawt.so jdk-13.0.1/lib/libjdwp.so jdk-13.0.1/lib/libjimage.so jdk-13.0.1/lib/libjli.so jdk-13.0.1/lib/libjsig.so jdk-13.0.1/lib/libjsound.so jdk-13.0.1/lib/liblcms.so jdk-13.0.1/lib/libmanagement.so jdk-13.0.1/lib/libmanagement_agent.so jdk-13.0.1/lib/libmanagement_ext.so jdk-13.0.1/lib/libmlib_image.so jdk-13.0.1/lib/libnet.so jdk-13.0.1/lib/libnio.so jdk-13.0.1/lib/libprefs.so jdk-13.0.1/lib/librmi.so jdk-13.0.1/lib/libsaproc.so jdk-13.0.1/lib/libsctp.so jdk-13.0.1/lib/libsplashscreen.so jdk-13.0.1/lib/libsunec.so jdk-13.0.1/lib/libunpack.so jdk-13.0.1/lib/libverify.so jdk-13.0.1/lib/libzip.so jdk-13.0.1/lib/modules jdk-13.0.1/lib/psfont.properties.ja jdk-13.0.1/lib/psfontj2d.properties jdk-13.0.1/lib/security/blacklisted.certs jdk-13.0.1/lib/security/cacerts jdk-13.0.1/lib/security/default.policy jdk-13.0.1/lib/security/public_suffix_list.dat jdk-13.0.1/lib/server/classes.jsa jdk-13.0.1/lib/server/libjsig.so jdk-13.0.1/lib/server/libjvm.so jdk-13.0.1/lib/src.zip jdk-13.0.1/lib/tzdb.dat jdk-13.0.1/man/man1/jabswitch.1 jdk-13.0.1/man/man1/jaccessinspector.1 jdk-13.0.1/man/man1/jaccesswalker.1 jdk-13.0.1/man/man1/jaotc.1 jdk-13.0.1/man/man1/jar.1 jdk-13.0.1/man/man1/jarsigner.1 jdk-13.0.1/man/man1/java.1 jdk-13.0.1/man/man1/javac.1 jdk-13.0.1/man/man1/javadoc.1 jdk-13.0.1/man/man1/javap.1 jdk-13.0.1/man/man1/jcmd.1 jdk-13.0.1/man/man1/jconsole.1 jdk-13.0.1/man/man1/jdb.1 jdk-13.0.1/man/man1/jdeprscan.1 jdk-13.0.1/man/man1/jdeps.1 jdk-13.0.1/man/man1/jfr.1 jdk-13.0.1/man/man1/jhsdb.1 jdk-13.0.1/man/man1/jinfo.1 jdk-13.0.1/man/man1/jjs.1 jdk-13.0.1/man/man1/jlink.1 jdk-13.0.1/man/man1/jmap.1 jdk-13.0.1/man/man1/jmod.1 jdk-13.0.1/man/man1/jps.1 jdk-13.0.1/man/man1/jrunscript.1 jdk-13.0.1/man/man1/jshell.1 jdk-13.0.1/man/man1/jstack.1 jdk-13.0.1/man/man1/jstat.1 jdk-13.0.1/man/man1/jstatd.1 jdk-13.0.1/man/man1/keytool.1 jdk-13.0.1/man/man1/kinit.1 jdk-13.0.1/man/man1/klist.1 jdk-13.0.1/man/man1/ktab.1 jdk-13.0.1/man/man1/pack200.1 jdk-13.0.1/man/man1/rmic.1 jdk-13.0.1/man/man1/rmid.1 jdk-13.0.1/man/man1/rmiregistry.1 jdk-13.0.1/man/man1/serialver.1 jdk-13.0.1/man/man1/unpack200.1 jdk-13.0.1/release root@localhost:/home/user/Downloads/installer# ls
3. In this article, in order to organize the binary application or program in an organized manner, ‘/opt’ is the target of the location to place the java folder binary program. Just execute the following command to move it to the ‘/opt’. The location can be vary depends on the practice or the way every person organize its files and folders. But in this article, ‘/opt’ is the chosen folder for storing the java folder binary program. Move it as follows :
root@localhost:/home/user/Downloads/installer# ls jdk-13.0.1 jdk-13.0.1_linux-x64_bin.tar.gz root@localhost:/home/user/Downloads/installer# mv -vf jdk-13.0.1 /opt/ renamed 'jdk-13.0.1' -> '/opt/jdk-13.0.1' root@localhost:/home/user/Downloads/installer#
Configuring Linux Ubuntu 19.04 for Java Installation using update-alternatives
Apparently, although the java binary program exist in the folder ‘/opt/jdk-13.0.1’, the execution of the java binary program is still failed. In order for the operating system recognizes the java binary program, add it as a command which is available for calling the java binary program using the symbolic link. So, do the following steps for configuring the operating system :
1. Use the tool ‘update-alternatives’ command to create symbolic link to the java program or binary. Try to execute the following command :
update-alternatives --config java
The following is the above command execution :
root@localhost:/home/user/Downloads/installer# update-alternatives --config java update-alternatives: error: no alternatives for java root@localhost:/home/user/Downloads/installer#
2. Since there is no symbolic link available as it exist in the above output command execution, try to add a new symbolic link for the java program or binary. Just execute the following command pattern :
update-alternatives --install /path/java/symbolic_link java /path/java/binary/program integer_number
The following is an example of command execution using the above command pattern :
root@localhost:/home/user/Downloads/installer# update-alternatives --install /usr/bin/java java /opt/jdk-13.0.1/bin/java 0 update-alternatives: using /opt/jdk-13.0.1/bin/java to provide /usr/bin/java (java) in auto mode root@localhost:/home/user/Downloads/installer#
3. After that, don’t forget to execute the ‘java’ program binary by typing it in the command line as follows :
root@localhost:/home/user/Downloads/installer# java Usage: java [options] [args...] (to execute a class) or java [options] -jar [args...] (to execute a jar file) or java [options] -m [/] [args...] java [options] --module [/] [args...] (to execute the main class in a module) or java [options] [args] (to execute a single source-file program) Arguments following the main class, source file, -jar , -m or --module / are passed as the arguments to main class. where options include: -cp -classpath --class-path A : separated list of directories, JAR archives, and ZIP archives to search for class files. -p --module-path ... A : separated list of directories, each directory is a directory of modules. --upgrade-module-path ... A : separated list of directories, each directory is a directory of modules that replace upgradeable modules in the runtime image --add-modules [,...] root modules to resolve in addition to the initial module. can also be ALL-DEFAULT, ALL-SYSTEM, ALL-MODULE-PATH. --list-modules list observable modules and exit -d --describe-module describe a module and exit --dry-run create VM and load main class but do not execute main method. The --dry-run option may be useful for validating the command-line options such as the module system configuration. --validate-modules validate all modules and exit The --validate-modules option may be useful for finding conflicts and other errors with modules on the module path. -D= set a system property -verbose:[class|module|gc|jni] enable verbose output for the given subsystem -version print product version to the error stream and exit --version print product version to the output stream and exit -showversion print product version to the error stream and continue --show-version print product version to the output stream and continue --show-module-resolution show module resolution output during startup -? -h -help print this help message to the error stream --help print this help message to the output stream -X print help on extra options to the error stream --help-extra print help on extra options to the output stream -ea[:...|:] -enableassertions[:...|:] enable assertions with specified granularity -da[:...|:] -disableassertions[:...|:] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:[=] load native agent library , e.g. -agentlib:jdwp see also -agentlib:jdwp=help -agentpath:[=] load native agent library by full pathname -javaagent:[=] load Java programming language agent, see java.lang.instrument -splash: show splash screen with specified image HiDPI scaled images are automatically supported and used if available. The unscaled image filename, e.g. image.ext, should always be passed as the argument to the -splash option. The most appropriate scaled image provided will be picked up automatically. See the SplashScreen API documentation for more information @argument files one or more argument files containing options -disable-@files prevent further argument file expansion --enable-preview allow classes to depend on preview features of this release To specify an argument for a long option, you can use --= or -- . root@localhost:/home/user/Downloads/installer#
4. Last but not least, try to execute the java binary program or command with the additional parameter showing the version as follows :
root@localhost:/home/user/Downloads/installer# java --version java 13.0.1 2019-10-15 Java(TM) SE Runtime Environment (build 13.0.1+9) Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing) root@localhost:/home/user/Downloads/installer#