Install jdk on linux mint

Install jdk on linux mint

Just wanted to inform, this STILL works !! jdk19 ! 🙂 Thank you !

In step 8, I found I didn’t need the update-alternatives —set call. The —install call did everything I needed.

The JDK installation has several other programs besides java, such as javac, javadoc, and javap. I made a shell script of update-alternatives —install calls for each of them and ran that as root to finish the installation.

To the previous user: I suspect that the problem is that you literally copied and pasted jdk1.7.0_25 when you were actually installing a different version. Try using the actual directory name created when you unpacked the tarball.

I get the following error;
update-alternatives: error: alternative path /opt/java/jdk1.7.0_25/bin/java doesn’t exist

@matpil
Thanks for your help

@rtiwari95
Hi, you need to use sudo also on the second part of the command:
sudo apt-get update && sudo apt-get remove openjdk*

Another «issue»:
For mozilla plugin the commands are:
mkdir -p ~/.mozila/plugins
ln -s /opt/java/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so ~/.mozila/plugins/

i have a problem
showing this after entering first command please help!
E: Could not open lock file /var/lib/dpkg/lock — open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Good job dudko and wolfred.It worked for me.
Linux Mint 18-1 «Serena» Mate 64 bit
java version 1.8.0_112
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
Appreciate it guys!!

Thanks a lot for this great tutorial.
Easy to understand and it worked for me.
Mint 17.3 KDE now
java version «1.8.0_111»
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Nicely written, works like charm. Thank you!!

I have a problem when i run «Javac»:

$ javac
The program ‘javac’ can be found in the following packages:
* default-jdk
* ecj
* gcj-4.6-jdk
* gcj-4.7-jdk
* openjdk-7-jdk
* openjdk-6-jdk
Try: sudo apt-get install

So i installed default-jdk from the software manager and problem SOLVED.

In this tutorial it explain another way to solve this problem.

$ update-alternatives —install /usr/bin/javac javac /opt/java/jdk1.8.0_101/bin/javac 100
$ update-alternatives —config javac

Very nice tutorial, thank you sir 🙂

Kernel: 3.19.0-32-generic x86_64 (64 bit)
Desktop: Cinnamon 2.8.8
Distro: Linux Mint 17.3 Rosa

Читайте также:  Настройка сервера vpn linux

java version «1.8.0_91»
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

I followed the Tutorial that describes how to install using the ppa created by webupd8.org. (Search for the that article.)

There are simpler ways to get Java onto the machine than this convoluted article shows.

The instructions are a bit terse, there is plenty of room for stuff to go wrong,
for instance:
I have a non standard location for my downloads even though I fixed it so that it still looks like it is under my home directory so when i did your step 5 I got a mass of errors that quickly zipped off the screen and if I hadnt noticed them would have left my Java folder short of a couple of hundred of the most important files, I looked in the folder and it had lots of stuff there so thought maybe they had been warnings went and had a look it was a permission thing I went back to step 5 and added sudo to the beginning of your first line and it went thru.

Also in your final Optinal(sic) step you have mispelled mozilla — not sure if thats an issue actually but makes me a bit suspicious that you didnt actually run those commands — just typed them here. And there is simply not enough information there to know how the .mozilla/plugins folder will be used and by who, I had a look around and firefox has a couple of plugins directories but not there, and will this work for multiple users or just me?

This is all intended as constructive criticism, I appreciate the effort you put into it, I just dont want anyone to come to grief because of it.

Thanks a lot. Worked perfectly 🙂

Источник

How to Install Java on Ubuntu and Linux Mint

Wondering about how to install Java on Ubuntu? Installing Java is certainly one of the first few things to do after installing Ubuntu and it is very easy to do so.

Many people have aversion to Java. But there are high chances that for one reason or other, you might have to install Java, no matter how much you dislike it. In this quick post, we shall see how to install Java in Ubuntu, Linux Mint and other Debian and Ubuntu based distributions.

You can get Java on Ubuntu via multiple packages. There is JRE, OpenJDK and Oracle JDK. But what is the difference between these packages and which one should you install? Let me explain that in the next section.

JRE vs OpenJDK vs Oracle JDK

Before we go on seeing the process to install Java, let’s quickly understand the difference between JRE, OpenJDK and Oracle JDK.

  • JRE (Java Runtime Environment) is what you would need normally to run a Java-based application on Ubuntu. This is all you need if you are not a programmer.
  • JDK (Java Development Kit) is what you need to if you have to do some programming or develop software related to Java.
  • OpenJDK is Open Source implementation of Java Development Kit while Oracle JDK is the official Oracle version of Java Development Kit. While OpenJDK is sufficient for most of the cases, some programs such Android Studio suggests using Oracle JDK to avoid UI/performance issue.
Читайте также:  Операционная система линукс состав

Now that you know the difference between JRE, JDK, OpenJDK and Oracle JDK, you should make a decision to install one of these packages.

Once you do that, it’s time to see how to install these packages and get Java on your Ubuntu Linux.

Check if Java is already installed in Ubuntu

Before you see how to install Java, you should verify if Java is already installed. This is also helpful in knowing which version of Java is installed on your system.

Open a terminal and use the following command:

If you have Java installed, you should see an output like this:

openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

As you can see in the above output, the system has Java 10 installed via OpenJDK.

If you don’t have Java installed on your system, you’ll see an output like this:

The program ‘java’ can be found in the following packages:
* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install

Basically Ubuntu is giving you hint about the various packages you can install to get Java.

Install Java in Ubuntu and Linux Mint

Installing Java on Ubuntu

Once we have see the difference between various types of ‘Java’, let’s see how to install them.

Install JRE in Ubuntu and Linux Mint (for running Jar applications)

JRE is required for running Jar files on Ubuntu. Jar files are basically precompiled Java files. As an end user, you just want to use Java application and for that, you’ll need JRE.

Open terminal and use the following command to install JRE:

sudo apt install default-jre

This will install the latest JRE available from Ubuntu. But if you want to install a specific version, you can use openjdk-8-jre, openjdk-7-jre/openjdk-6-jre instead of default-jre in the above command.

Install OpenJDK in Ubuntu and Linux Mint (for compiling and running Java programs)

As mentioned previously, if you want to compile and run Java programs on Ubuntu, you need the JDK. It contains the Java Compiler (javac) package.

In a terminal, use the following command to install OpenJDK Java Development Kit:

sudo apt install default-jdk

If you are specifically looking to install Java 8, Java 7 or Java 6 etc, you can use openjdk -8- jdk , openjdk -7- jdk / openjdk -6- jdk .

Читайте также:  Gui application in linux

Install Oracle JDK in Ubuntu and Linux Mint

Use the following commands to install Oracle JDK in Ubuntu and Linux Mint. Just a heads up, it will download plenty of files. So make sure you have good internet speed:

sudo add-apt-repository ppa:linuxuprising/java sudo apt update

If you want to install Java 11 and set it as default, use the following command:

sudo apt install oracle-java11-installer-local

If you want to use this recently installed Oracle Java 11 as the default Java version on your system, use the following command:

sudo apt install oracle-java11-set-default-local

It will change the default Java version to Oracle Java 11, setting it in the JAVA_HOME variable and PATH variables.

Similarly, if you want to install Java 16 and set it as default, use the following command:

sudo apt install oracle-java16-installer-local sudo apt install oracle-java8-set-default-local

Now that you learned to install Java on Ubuntu, you may want to improve your Java skills. I suggest trying the interactive Java Tutorial by CodeGym. It’s a fun and engaging way to learn Java.

Any questions or suggestions are always welcomed.

Источник

How to Install Java in Linux Mint 20.3

Java is one of the most widely used high level programming languages available in the market. Along with that, this programming language is extremely easy to learn and once you get your hands on it, it will help you a lot with the complex programmatic tasks. In this guide, we will learn to install the Java programming language on a Linux Mint 20.3 system together.

How Can I Install Java in Linux Mint 20.3?

You can install Java in your Linux Mint 20.3 system in just three simple steps that are explained in the following:

Step 1: Install the Java Development Kit

First, you need to install the Java Development Kit (JDK) on your system with the command that follows:

Step 2: Install the Java Runtime Environment

Now, you can also install the Java Runtime Environment (JRE) by executing the following command:

Step 3: Check the Installed Version of Java

Once both the JDK and JRE are installed successfully in your Linux Mint 20.3 system, you can confirm the Java installation by checking its version with the following command:

The following image confirms the installation of Java in our Linux Mint 20.3 system:

Conclusion

By following the three simple steps explained, you can quickly install the Java programming language in your Linux Mint 20.3 system and start coding with this high level programming language right away.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

Источник

Оцените статью
Adblock
detector