• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java in Linux  RSS feed

 
Rrohit rakesh upadhyay
Ranch Hand
Posts: 94
1
Java Notepad Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded and extracted "jdk-8u25-linux-x64.tar.gz" in my linux mint 17.1, but when i try to compile a file using "javac" in the command line i get a message like the following:

javac could be present in the following packages

ecj
default-jdk
open-7-jdk

try "sudo apt-get install <package name>" to install the package


It does not state anything about the "jdk-8u25-linux-x64.tar.gz",what should i do about it?


Thank you
 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I trust you have read the Oracle JDK 8 and JRE 8 Installation Overview before asking your question here? Perhaps you missed a step?
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recent Linux distros come with an open-source implementation of Java. That's what apt-get is offering to download and install.

Don't let it. That product isn't fully capable, at least for J2EE. You want to use the Oracle JDK that you downloaded.

To do that, the recommended process is to setup the environment/execution path as follows:


Once you do that, the "java -version" command should indicate that you're running the desired java distro.

You can put these lines into your ~/.bash_profile file and they will be executed automatically every time you log in. Assuming you're using bash. Do the equivalent for whatever shell you prefer.
 
Rico Felix
Ranch Hand
Posts: 411
5
IntelliJ IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The simplest method is to input the following commands into your shell:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
 
Andrew Polansky
Ranch Hand
Posts: 310
18
Linux MS IE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In past I wrote a super simple bash script that I use to install Java on other computers based on Debian/Ubuntu. It works on my Mint perfectly.

Make sure you have extracted jdk-8u25-linux-x64.tar.gz to /usr/local/java/jdk1.8.0_25 and then the run the script below.



If everything went correctly, you will see something like this at the end of the script's output:

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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!