Linux mint java 8 oracle

Linux mint java 8 oracle

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

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.

Читайте также:  text-transform

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 🙂

Источник

Install Oracle Java 8 In Ubuntu Or Linux Mint Via PPA Repository [JDK8]

The Oracle JDK License has changed for releases starting April 16, 2019.

The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost — but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

Oracle Java 8 is now stable. Below you’ll find instructions on how to install it in Ubuntu / Linux Mint via a PPA repository. The PPA supports JDK8 for both 32bit and 64bit as well as ARM (ARM v6/v7 Hard Float ABI — there’s no JDK 8 ARM Soft Float ABI archive available for download on Oracle’s website).

As a reminder, the WebUpd8 Oracle Java PPA doesn’t include any Java binaries, just a script that automatically downloads and install Oracle Java 8. Everything is done automatically so you’ll get updates through the update manager for JDK8 which includes JRE8 and the Java browser plugin.

It’s also important to note that the Oracle Java 8 installer is considered in alpha and is offered without any guarantees! Use it at your own risk. If you ISP or router blocks the ports used by the Oracle Java 8 download servers, the installation may fail.

Читайте также:  HTML-комментарии

If you want to install Oracle Java 7 instead, see THIS post (PPA for all supported Ubuntu / Linux Mint versions).

Debian users will find installation instructions in the following article: How To Install Oracle Java 8 In Debian Via Repository [JDK8]

Install Oracle Java 8 (JDK8 and JRE8) in Ubuntu or Linux Mint

Oracle JDK8 installer

Oracle JDK8 installer

The installer provides Oracle Java 8 (which includes Java JDK, JRE and the Java browser plugin). However, you can’t only install Oracle JRE — the PPA only provides the full Oracle JDK8 package.

Our PPA supports Ubuntu 16.10, 16.04, 15.10, 14.04 and 12.04 as well as Linux Mint 18, 17.x and 13. Add the PPA and install Oracle Java 8 (the package provides both JDK8 and JRE8) using the following commands:

sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer

Previously, this package would increment the Java priority to make it default. The oracle-java8-installer package now sets the Java priority to 1081, and that may or may not set it as default, depending on other Java packages you may have installed (for instance, if Java 7 is also installed, Java 8 becomes default, but if Java 9 is installed, Java 8 doesn’t become default).

To make Java 8 default, you must install the «oracle-java8-set-default» package (which configures the Java environment variables and sets it as default), which I added as a «Recommended» package to «oracle-java8-installer».

In Ubuntu, recommended packages are automatically installed, so «oracle-java8-set-default» should be installed when installing «oracle-java8-installer». In Linux Mint on the other hand, recommended packages are not installed by default, so you must install this package manually if you want to set Oracle Java 8 as default.

So, if you want to set Oracle Java 8 as default, no matter what other Java versions are installed, make sure that you install the oracle-java8-set-default package (which, again, should be automatically installed with the main Oracle Java Installer package in Ubuntu, but not in Linux Mint):

sudo apt-get install oracle-java8-set-default

If you don’t want to make Oracle Java 8 default (it might still be set as default, depending on what other Java versions you may have installed), install the oracle-java8-installer with «—no-install-recommends»:

sudo apt-get install --no-install-recommends oracle-java8-installer

Note: removing the oracle-java8-set-default package does not undo all the changes (I have yet to find a way to do this properly). If you don’t want to set it as default, remove both oracle-java8-installer and oracle-java8-set-default packages, and then install oracle-java8-installer with «—no-install-recommends» (like mentioned above).


Tip: if you’re behind a firewall / router that blocks some of the redirects required to download the Oracle Java archive, you can download the JDK tar.gz archive manually and place it under /var/cache/oracle-jdk8-installer — then, installing the «oracle-java8-installer» package will use the local archive instead of trying it to download it itself.

After installing Oracle Java and the «oracle-java8-set-default» package, running «java -version» in a terminal should output something like this:

andrei@andrei-desktop:~$ java -version 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)
andrei@andrei-desktop:~$ javac -version javac 1.8.0_111

Automated installation (auto accept license)

The installer requires you to accept the Oracle license before the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command to automatically accept the Oracle license:

echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections

Switching between Oracle Java 9 and Java 7

You can have both Java 8 and Java 9 installed in the same time, but only one can be set as default.

Читайте также:  If else java with int

To set which is default, simply install its «set-default» package: oracle-java8-set-default for Oracle Java 8, or oracle-java9-set-default for Oracle Java 9.

Update: if you’re looking for Oracle Java 11, it’s available in a different PPA. See THIS article for instructions on installing it in Ubuntu or Debian. Oracle Java 15 on Ubuntu, Linux Mint or Debian from that same APT PPA repository.

Источник

Install Oracle Java 8 on Ubuntu, Linux Mint, Elementary OS

In this tutorial, I will show you how to install Oracle Java 8 on Ubuntu based Linux distributions, including Ubuntu 16.04/14.04, Linux Mint, Elementary OS, from PPA (Personal Package Archive). The following will be installed on your system once you finish this tutorial.

  • Java JDK (Java Development Kit)
  • JRE (Java Runtime Environment)
  • Java browser plugin

Programs written in Java such as phpStorm can run on any operating system that has Java installed.

Install Oracle Java 8 on Ubuntu/Linux Mint/Elementary OS

Run the following 3 commands one by one in your terminal to add the PPA and install Oracle Java8.

sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install java-common oracle-java8-installer

The 3rd command will install the Oracle Java8 installer and itself will download Oracle Java 8 binary and then install it on your system. During the installation phase, you need to accept the Oracle binary code license terms.

Install Oracle Java 8 on Ubuntu

Check Version Number

Once the installation is complete, we can check Java version.

Install Oracle Java 8 on Ubuntu

Check Java compiler version

Install Oracle Java 8 on Ubuntu

Set Environment Variable.

Run the following command to set environment variable.

sudo apt-get install oracle-java8-set-default

Once installed, there will be two new files under /etc/profile.d/ directory: jdk.csh and jdk.sh. These two files are shell scripts that contains commands to set 5 environment variables.

export J2SDKDIR=/usr/lib/jvm/java-8-oracle export J2REDIR=/usr/lib/jvm/java-8-oracle/jre export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin export JAVA_HOME=/usr/lib/jvm/java-8-oracle export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db

We need to reload /etc/profile to let these environment variables to take effect.

Now you can check these 5 environment variables like below:

Set Environment Variable.

As you can see, it’s easy to install Oracle Java 8 on Ubuntu, Linux Mint and Elementary OS once you read this tutorial. Comments, questions or suggestions are always welcome. If you found this post useful, ? please share it with your friends on social media! Stay tuned for more Linux tutorials.

Источник

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