Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Monday, 21 September 2015

Installing Java JDK on Centos

I used the instructions from THIS site to install Java on a Centos 6 vm.

Go to the Oracle Java download page and download the required version depending upon your distribution architecture.
As I use 64bit CentOS 7 server, I have downloaded the 64bit rpm package.
Install Java:
#rpm -ivh jdk-8u60-linux-x64.rpm
Test the Java Version:

# java -version

You will get the following output:

java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)



Wednesday, 6 May 2015

Ubuntu 14.04 how to change default Java

We had to change the default version of Java used from 7 to 8. I found THIS page which gave the solution below which worked:

Switching between installed Java versions can be accomplished using the update alternatives command.

To get a list of your installed Java platforms, run the following command from the terminal:

sudo update-alternatives --config java
This will give you a list output similar to this:

There are 2 choices for the alternative java (providing /usr/bin/java).
   Selection    Path                                           Priority   Status
  ------------------------------------------------------------
  0            /usr/lib/jvm/java-6-oracle/jre/bin/java         1070      auto mode
  1            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
* 2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1069      manual mode
Press enter to keep the current choice[*], or type selection number:
In this case, the Open JDK 6 version is running. To switch to the Open JDK version 7, you would select option 1 at the prompt and press the Enter key.

You will now be running the OpenJDK 7 version. No other changes will be needed to switch your Java versions.

Tuesday, 14 April 2015

How to install Java on Ubuntu 14.04 with apt-get

Had to install Java on Ubuntu 14.04 today used THIS site do do it using apt-get:

The process is as follows:

Installing Oracle JDK (optional)

The Oracle JDK is the official JDK; however, it is no longer provided by Oracle as a default installation for Ubuntu.
You can still install it using apt-get. To install any version, first execute the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Then, depending on the version you want to install, execute one of the following commands:

Oracle JDK 6

This is an old version but still in use.
sudo apt-get install oracle-java6-installer

Oracle JDK 7

This is the latest stable version.
sudo apt-get install oracle-java7-installer