November 18, 2019, 05:47:55 am

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


How to install Oracle Java 7

Started by maro, February 06, 2013, 01:26:08 pm

Previous topic - Next topic

maro

February 06, 2013, 01:26:08 pm Last Edit: February 08, 2013, 01:46:41 pm by maro
Hi,

this tutorial is how to install Java 7 Embedded from oracle.

First you must download the java package from this

http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html

open a terminal and digit mkdir /opt/java

extract the file from the archive downloaded before into the directory created

once done on the terminal digit nano /etc/profile


add :/opt/java/bin at the string called PATH=""
and add
export JAVA_HOME="/opt/java"


save the file and reboot, to try if java work on the terminal digit java -version

ikeeki

April 09, 2013, 01:58:34 pm #1 Last Edit: April 10, 2013, 10:27:17 am by ikeeki
Hi Maro, I am very interested in the java thing. This instructions could help me install java in any distro for cubie, or are you using a specific distro ┬┐?

Are we always talking on java languaje or could I use it for some apps or programs to run?


Thanks.

----------------------
Edit: I meant if the installation of java was fully functional or it was just for certain types of programs in console mode.

patwood

Did you have to install this on a soft float distro (armel instead of armhf)?

jiv

Oracle Java 7 is only SF.
But there is http://jdk8.java.net/download.html Java 8 early access with HardFloat. But its aimed for Rpi. Maybe someone could test it?  (i would but waiting for my cb)


gmorehou

I will be attempting this (Java 8 on Cubie) as soon as I have time, because I have a server Cubieboard A20 on which I want to run a couple Java apps, and they DO NOT work well with the GNUbeard JREs at all.

Otherland

Hi

I've installed Oracles JDK8, the early access version. and it seems to work. I'm using it run the Madsonic music server. It runs without any problems.

There should exist a JDK7 with hard fp (at least that's how I read it). The last time I looked the file name was: jdk-7u40-linux-arm-vfp-hflt.tar.gz
But I haven't tested it.

/Otherland

Otherland

Quote from: Otherland on October 14, 2013, 04:52:31 am
There should exist a JDK7 with hard fp (at least that's how I read it). The last time I looked the file name was: jdk-7u40-linux-arm-vfp-hflt.tar.gz
But I haven't tested it.


I've installed it now and it also works without any problems so far.
So I would say that both Java 7 and 8 works with hard floating points...

/Otherland

Dariush

October 31, 2013, 11:55:36 am #7 Last Edit: October 31, 2013, 02:06:18 pm by Dariush
Quote from: maro on February 06, 2013, 01:26:08 pm
Hi,

this tutorial is how to install Java 7 Embedded from oracle.

First you must download the java package from this

http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html

open a terminal and digit mkdir /opt/java

extract the file from the archive downloaded before into the directory created

once done on the terminal digit nano /etc/profile


add :/opt/java/bin at the string called PATH=""
and add
export JAVA_HOME="/opt/java"


save the file and reboot, to try if java work on the terminal digit java -version


Hi.
I've used the "jdk-7u45-linux-arm-vfp-hflt.tar.gz" and did whatever you said but it said "java:command not found.
The following part of instruction dosen't works!


add :/opt/java/bin at the string called PATH=""
and add
export JAVA_HOME="/opt/java"

Any suggestion?

guenter

Quote from: Dariush on October 31, 2013, 11:55:36 am
The following part of instruction dosen't works!


add :/opt/java/bin at the string called PATH=""
and add
export JAVA_HOME="/opt/java"

Any suggestion?


Try:
/opt/java/bin/java -version

If not, check the path - /opt/java/bin - is it OK?

atodea

I think the best way is:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-jdk7-installer´╗┐


At the time of this post, for the Cubie, it works for Cubiuntu0.6.5a-a20.img. For lubuntu-server-nand.img you need to make some adjustments:

sudo apt-get install software-properties-common

Backup your /etc/lsb-release and then replace it with:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu precise"

sudo add-apt-repository ppa:webupd8team/java

Restore the original /etc/lsb-release

sudo apt-get update
sudo apt-get install oracle-jdk7-installer´╗┐


Installing it this way is better then just copying the files and exporting the PATH and JAVA_HOME. It also adds the java "alternatives", etc.

turet

Quote from: atodea on December 27, 2013, 03:51:03 pmInstalling it this way is better then just copying the files and exporting the PATH and JAVA_HOME. It also adds the java "alternatives", etc.


I didn't know that, thanks for the information!

STrRedWolf

Some updated info for everyone, which works well with the Cubieez (Debian Wheezy for CubieTruck).  You'll need to be running as root, or have "sudo su -" to get to root shell:

First, get the Java 7 SE Embedded Headless ARMHF archive from the URL in the first post.  You'll need to log in to Oracle's site, of course.  Save this on the Cubie.

Next, unarchive this into /opt and point /opt/java to it.
# cd /opt
# tar xfvz /path/to/ejre-*.tar.gz
# ln -s ejre* java


Now go into /etc/profile.d/ and make "java.sh" in there:
# nano -w /etc/profile.d/java.sh
## Java info
PATH="${PATH}:/opt/java/bin"
export JAVA_HOME="/opt/java"


Finally, update your environment to bring the new stuff in.  /etc/profile brings in any file in /etc/profile.d:
# source /etc/profile