You are Here:
Linux Lite 5.2 RC1 is now available for download and testing



How to Install Java on Linux Lite

Author (Read 19844 times)

0 Members and 5 Guests are viewing this topic.

How to Install Java on Linux Lite
« on: December 24, 2015, 11:20:55 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7741
    Posts
  • Country: nz
  • Reputation: 732
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.0 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Install Java on Linux Lite - this tutorial will show you how to install Oracle's Java on Linux Lite. You must uninstall the openjdk java on Linux Lite first to have your system recognize and use Oracle's Java. Go into Synaptic package manager and remove packages labeled as 'openjdk' there will be only 2. An example of why people may want to use Oracle's Java over OpenJdk's Java is that they find Minecraft will only run under Oracle's or runs better under Oracle's Java.

NB: Best practice is to use only one type of Java on your system at a time. Yes, you can use symlinks, but this OS is for new folk to linux so we're keeping this very simple.

1. Download Java: 32bit or 64bit depending on your system - https://www.java.com/en/download/linux_manual.jsp



2. Open a terminal where the download is and enter:

Code: [Select]
sudo su
Code: [Select]
mkdir /usr/lib/jvm/oracle_jdk8
Code: [Select]
tar -zxvf jre-* -C /usr/lib/jvm/oracle_jdk8 --strip-components=1
Code: [Select]
touch /etc/profile.d/oraclejdk.sh
Code: [Select]
leafpad /etc/profile.d/oraclejdk.sh
copy and paste the following into the file, then save and close it:

Code: [Select]
export J2SDKDIR=/usr/lib/jvm/oracle_jdk8
export J2REDIR=/usr/lib/jvm/oracle_jdk8/jre
export PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/bin
export JAVA_HOME=/usr/lib/jvm/oracle_jdk8
export DERBY_HOME=/usr/lib/jvm/oracle_jdk8/db

In the same terminal type, exit.

Now enter:

Code: [Select]
source /etc/profile.d/oraclejdk.sh
Do:

Code: [Select]
java -version
in a terminal to confirm you have Oracle's Java installed.

Code: [Select]
jerry@jerry-VirtualBox:~$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) Server VM (build 25.66-b17, mixed mode)
jerry@jerry-VirtualBox:~$
Last Edit: December 24, 2015, 11:37:39 PM by Jerry
 


Re: How to Install Java on Linux Lite
« Reply #1 on: January 27, 2016, 09:14:05 PM »
 

LinuxNoob

  • Forum Regular
  • ***
  • 108
    Posts
  • Country: ca
  • Reputation: 11
  • Linux Lite Member

  • Linux Lite: 3.2 64bit

  • CPU: 6x AMD Phenom(tm) II X6 1045T Processor

  • MEMORY: 8Gb

  • VIDEO CARD: Gallium 0.4 on AMD RS780
I would like to add this webpage that I found that could make it a bit easier to install the Java JRE

https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

I appreciate it when installers exist to make my LL experience more FUNNER! :)

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


It starts an installer. The page also has other versions

I'v been bashing Windows way before Microsoft.....
 

Re: How to Install Java on Linux Lite
« Reply #2 on: February 29, 2016, 01:38:27 PM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
how do I uninstall java
 

Re: How to Install Java on Linux Lite
« Reply #3 on: March 24, 2016, 01:05:46 PM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
How can I uninstall Java as I do not need it anymore?
 

Re: How to Install Java on Linux Lite
« Reply #4 on: March 25, 2016, 01:07:22 PM »
 

avj

  • Gold Level Poster
  • *******
  • 530
    Posts
  • Country: us
  • Reputation: 110
  • Linux Lite Member

  • Linux Lite: 2.8 64bit

  • CPU: Dual core Intel Pentium D 2.80GHz

  • MEMORY: 2Gb

  • VIDEO CARD: AMD/ATI RC410 Radeon Xpress 200/1100
If you know which packages were installed, they can be removed from: Install/Remove Software. Make sure to only remove what you installed as some java packages may have been installed by default, and removing them may cause system problems.
I have not failed. Ive just found 10,000 ways that wont work. - Thomas Edison
 

Re: How to Install Java on Linux Lite
« Reply #5 on: March 30, 2016, 12:05:46 PM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
Not OpenJDK but Oracle's
 

Re: How to Install Java on Linux Lite
« Reply #6 on: March 30, 2016, 12:57:34 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Country: gb
  • Reputation: 404
  • Linux Lite "Advocate"

  • Linux Lite: 2.8 64bit

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Does this help..??
Via the FAQ's on the download page: How do I uninstall Java for Linux ?
https://www.java.com/en/download/help/linux_uninstall.xml
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: How to Install Java on Linux Lite
« Reply #7 on: March 30, 2016, 05:06:53 PM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
Well I used this guide and it seemed confusing.

Sent from my K00L using Tapatalk

 

Re: How to Install Java on Linux Lite
« Reply #8 on: March 30, 2016, 05:08:42 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7741
    Posts
  • Country: nz
  • Reputation: 732
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.0 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
We need to know how you installed it in the first place.
 

Re: How to Install Java on Linux Lite
« Reply #9 on: March 31, 2016, 01:21:51 AM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
Go up to the first post exactly like it. Same commands and everything.

Sent from my K00L using Tapatalk
Last Edit: March 31, 2016, 01:25:28 AM by liamjake05
 

Re: How to Install Java on Linux Lite
« Reply #10 on: March 31, 2016, 01:52:00 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7741
    Posts
  • Country: nz
  • Reputation: 732
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.0 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Open a terminal, try:

Code: [Select]
sudo su
cd /usr/lib/jvm
rm -rf oracle_jdk8/
rm -rf /etc/profile.d/oraclejdk.sh

then:

Code: [Select]
java -version
should return something like:

Code: [Select]
test32@test32-VirtualBox:~$ java -version
The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.8-jre-headless
 * openjdk-7-jre-headless
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
Try: sudo apt-get install <selected package>
test32@test32-VirtualBox:~$

If it doesn't, reboot and try java -version again.
 

Re: How to Install Java on Linux Lite
« Reply #11 on: March 31, 2016, 01:59:36 AM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
I still have openjdk so I assume it will be the same

Sent from my K00L using Tapatalk

 

Re: How to Install Java on Linux Lite
« Reply #12 on: March 31, 2016, 02:19:39 AM »
 

stop0x0000000a

  • New to Forums
  • *
  • 18
    Posts
  • Reputation: 6
  • Linux Lite Member
I still have openjdk so I assume it will be the same

Sent from my K00L using Tapatalk

Java is just a folder + a couple of environment variables.
No folder = no java anymore.

You can have more than one JDK installed, this case that profile JAVA_HOME selects the particular one to use.



 

Re: How to Install Java on Linux Lite
« Reply #13 on: March 31, 2016, 04:18:35 AM »
 

liamjake05

  • Forum Regular
  • ***
  • 100
    Posts
  • Country: mt
  • Reputation: 3

  • Linux Lite: 4.6 64bit

  • MEMORY: 4Gb
So what do you mean

Sent from my K00L using Tapatalk

 

Re: How to Install Java on Linux Lite
« Reply #14 on: March 31, 2016, 06:37:26 AM »
 

stop0x0000000a

  • New to Forums
  • *
  • 18
    Posts
  • Reputation: 6
  • Linux Lite Member
So what do you mean

if you have done the things above:

Code: [Select]
cd /usr/lib/jvm
rm -rf oracle_jdk8/

you've completed your mission successfully, no more Java ;)

I am a Java programmer actually, dozen of JVM installed and I simply delete their folders, if they are not needed anymore.
 


Tags:
 


Linux Lite 5.2 RC1 is now available for download and testing