SETUIX.COM

The Technological Divide

  • Forum
  • Android
  • Linux
  • Microsoft
  • Apple
  • WordPress
    • WordPress Themes
  • Wallpapers
  • Tech
  • Web
Home Linux Install Java Development Kit on Linux Mint

2 January, 2015 By Damian de Costa

Install Java Development Kit on Linux Mint

Before installing Oracle’s Java Development Kit (JDK), we will remove OpenJDK as Linux Mint comes with the OpenJDK version of Java libraries. Android development is an example of why OpenJDK should not be used.

Installing Oracle JDK on Debian / Linux Mint

1. Remove current OpenJDK or IcedTea installations.

sudo apt-get update
sudo apt-get remove openjdk* icedtea* default-jre default-jdk gcj-jre gcj-jdk icedtea-{6..7}-plugin icedtea-plugin

sudo apt-get autoremove
sudo apt-get autoclean

2. Download Oracle JDK here. Choose the correct version for your system architecture, x86 or x64. To determine if your system is 32 or 64 bit, run uname -m in a terminal.

3. Create a directory named java in /opt and move the downloaded JDK into /opt/java/ then extract the .tar.gz file there. At the time of writing, the JDK version was jdk-8u25-linux-x64.tar.gz

sudo mkdir /opt/java
sudo tar -zxvf  jdk-8u25-linux-x64.tar.gz

4. Next we will set Oracle JDK as the default JVM. To set it as the default JVM in your machine, run the following:

sudo update-alternatives –install /usr/bin/java java /opt/java/jdk1.8.0_25/bin/java 100
sudo update-alternatives –install /usr/bin/javac javac /opt/java/jdk1.8.0_25/bin/javac 100

5. Verify that Java has been successfully installed.

java -version
javac – version

You should an output similar to the below:

zero@zenith:/opt/java$ java -version
java version “1.8.0_25”
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

zero@zenith:/opt/java$ javac -version
javac 1.8.0_25

Updating Java on Debian / Linux Mint

1. To update Java, simply download the latest version from Oracle’s website.

2. Extract the tarball under /opt/java then set it up as the default JVM with a higher priority number.

3. During installation we used 100 as the priority number, when updating use 110. Below is an example:

update-alternatives –install /usr/bin/java java /opt/java/jdk2.2.2_22/bin/java 110
update-alternatives –install /usr/bin/javac javac /opt/java/jdk2.2.2_22/bin/javac 110

4. (Optional) – Delete the old version of Java.

update-alternatives –remove java /opt/java/jdk.old.version/bin/java
update-alternatives –remove javac /opt/java/jdk.old.version/bin/javac

rm -rf /opt/java/jdk.old.version

Filed Under: Linux Tagged With: Java, JDK, JVM

About Damian de Costa

I'm the founder of Setuix Solutions. I'm also a tech junkie with a passion for reading and gaming. Debian user that has given up on Windows and a huge heavy metal fan with a knack of breaking things.

Hey, read these articles too!

How to change Windows hosts file

ExpressionEngine 2 with PHP 7

Windows-Cortana

Will Cortana Sway the Masses from Google to Microsoft

Public, Private and Hybrid Clouds

Windows 10 Update & Upgrade FUD

What to Look For in Your Web Hosting Provider

icloud

Ten Tips for Selecting Your Cloud Service Vendor

Terminator Genisys WallPapers

Is Artificial Intelligence Dangerous?

Microsoft’s Desperate Attempts at Saving Windows Mobile

· About Us · Contact Us · Privacy Policy · DMCA Policy · Sitemap · Contributors · RSS · Hosting Services ·

Copyright © 2023 setuix.com