• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Java in Linux

 
Ranch Hand
Posts: 94
1
Oracle Notepad Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 5965
410
IntelliJ IDE Python TypeScript Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 28704
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 411
5
IntelliJ IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 310
18
MS IE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
reply
    Bookmark Topic Watch Topic
  • New Topic