Howto install Oracle's Java on LMDE/Debian

Archived topics about LMDE 1 and LMDE 2
äxl

Re: Howto install Oracle's Java on LMDE/Debian

Post by äxl »

Thanks, craig and zz. The lib is installed but not linked to Opera, BUT:
Settings - Preferences - Advanced - Downloads - Search "java"
It's showing about 30 MIME-types "application/x-java-...". When you click Edit they all "Use plug-in: Java(TM) Plug-in 1.6.0_26 - /usr/lib/mozilla/plugins/libjavaplugin.so"
I guess removing sun-java now is the easiest way to solve this. I'll need icedtea for starters, right?
mintyed wrote:[*]I could not press OK so i continued the rest of the steps and built the package for java.
Should have hit Enter.
[*]when it came to install the new java file. it gave message "cannot run more than one package manager at a time".
I guess dpkg --configure is still running in background. Could you please try:

Code: Select all

sudo dpkg-reconfigure java-package
...and hit Enter. ;)

It's calling java-package.postinst and whiptail to show the window. Though it's not a good idea and could cripple your system: You could try to kill these processes.
mintyed

Re: Howto install Oracle's Java on LMDE/Debian

Post by mintyed »

äxl wrote:Thanks, craig and zz. The lib is installed but not linked to Opera, BUT:
Settings - Preferences - Advanced - Downloads - Search "java"
It's showing about 30 MIME-types "application/x-java-...". When you click Edit they all "Use plug-in: Java(TM) Plug-in 1.6.0_26 - /usr/lib/mozilla/plugins/libjavaplugin.so"
I guess removing sun-java now is the easiest way to solve this. I'll need icedtea for starters, right?
mintyed wrote:[*]I could not press OK so i continued the rest of the steps and built the package for java.
Should have hit Enter.
[*]when it came to install the new java file. it gave message "cannot run more than one package manager at a time".
I guess dpkg --configure is still running in background. Could you please try:

Code: Select all

sudo dpkg-reconfigure java-package
...and hit Enter. ;)

It's calling java-package.postinst and whiptail to show the window. Though it's not a good idea and could cripple your system: You could try to kill these processes.
its ok i got the solution.
I could not hit enter as the ok button was not selected
A kind person in our #linuxmint-debian channel. said to press tab first. which did the trick.

I suggest whomever wrote this topic mention that step when the windows comes up.
It may be obvious thing to do. but i did not think of it. others might not either.
äxl

Re: Howto install Oracle's Java on LMDE/Debian

Post by äxl »

A new version is out: 6 Update 32
This was my first install. But jdownloader's context/menues weren't working. (It turned out to be a problem with full screen! So propably a jd bug.)

First I had some difficulties finding the old 31 Update. But finally found it here:
http://www.oracle.com/technetwork/java/ ... 01637.html
I tried JRE 7 Update 4 from the package description. ;)
http://www.oracle.com/technetwork/java/ ... index.html
Installed it like this:
1. Choose the right tar.gz archive and unpack it
2. Move the folder jre1.7.0_VERSION with root rights to /opt/java/32/ or /opt/java/64/
3. Exit running web browser (If you have a browser plugin folder you should delete it to avoid problems with dupe files. For example Firefox has ~/.mozilla/plugins/)
4. Installing it in the Alternatives System (http://wiki.debian.org/DebianAlternatives):
32-Bit:

Code: Select all

    sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/32/jre1.7.0_VERSION/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/32/jre1.7.0_VERSION/bin/javaws" 1
    sudo update-alternatives --install "/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so" "/opt/java/32/jre1.7.0_VERSION/lib/i386/libnpjp2.so" 1
64-Bit:

Code: Select all

    sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_VERSION/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/64/jre1.7.0_VERSION/bin/javaws" 1
    sudo update-alternatives --install "/usr/lib/mozilla/plugins/mozilla-javaplugin.so" "mozilla-javaplugin.so" "/opt/java/64/jre1.7.0_VERSION/lib/amd64/libnpjp2.so" 1 
5. Configuring the Alternatives System:
32-Bit:

Code: Select all

    sudo update-alternatives --set "java" "/opt/java/32/jre1.7.0_VERSION/bin/java"
    sudo update-alternatives --set "javaws" /opt/java/32/jre1.7.0_VERSION/bin/javaws
    sudo update-alternatives --set "mozilla-javaplugin.so" "/opt/java/32/jre1.7.0_VERSION/lib/i386/libnpjp2.so" 
64-Bit:

Code: Select all

    sudo update-alternatives --set "java" "/opt/java/64/jre1.7.0_VERSION/bin/java"
    sudo update-alternatives --set "javaws" /opt/java/64/jre1.7.0_VERSION/bin/javaws
    sudo update-alternatives --set "mozilla-javaplugin.so" "/opt/java/64/jre1.7.0_VERSION/lib/amd64/libnpjp2.so" 
Tutorial translated from http://wiki.ubuntuusers.de/Java/Install ... racle_Java (CC)
Only after a reboot I realized it worked but it shouldn't be necessary ... 6 Update 32 is also working.
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

Updates are out for Java 1.6 and 1.7.
Java SE Downloads : http://www.oracle.com/technetwork/java/ ... index.html

Code: Select all

Java - Version: 1.6.0_32
The next generation Java plug-in for Mozilla browsers.
Name:	Java(TM) Plug-in 1.6.0_32
Description:	The next generation Java plug-in for Mozilla browsers.
Version:	1.6.0_32
Location:	/usr/lib/jvm/j2re1.6-oracle/lib/i386/libnpjp2.so
Type:	NPAPI
The above Ubuntu way is needlessly complicated, like everything involving Ubuntu.
äxl

Re: Howto install Oracle's Java on LMDE/Debian

Post by äxl »

craigevil wrote:The above Ubuntu way is needlessly complicated, like everything involving Ubuntu.
So you know a better way to install 7? I have only found the tar.gz and rpm so either you use the Ubuntu or the Red Hat way ...
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

äxl wrote:
craigevil wrote:The above Ubuntu way is needlessly complicated, like everything involving Ubuntu.
So you know a better way to install 7? I have only found the tar.gz and rpm so either you use the Ubuntu or the Red Hat way ...
Crap seems you are right, wonder why Oracle didn't create a bin like they do for Java 1.6?

Going to see if I can get it to work using the rpm and alien. Will post details if it works or not.

No go for alien.

For now I am sticking with Java 1.6 it works, and installs easily using java-package.

I apologize about 1.7 seems it is a pita. Too bad the Debian devs decided OpenJDK7 needs half of Gnome as depends or I would use it.
roger64
Level 4
Level 4
Posts: 279
Joined: Wed Jun 01, 2011 5:48 am

Re: Howto install Oracle's Java on LMDE/Debian

Post by roger64 »

Hi

Code: Select all

 java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Image

I have been offered the update this morning from 1.6.32
I use LMDE64 (tracking testing) and tracks this repo: deb http://www.duinsoft.nl/pkg debs all
The update is triggered by the package: update-sun-jre.
I find its use very convenient. All java links (Firefox 12, LibreOfice...) are updated too.
Web site and install info here: http://www.duinsoft.nl/packages.php?t=en
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

roger64 wrote:Hi

Code: Select all

 java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Image

I have been offered the update this morning from 1.6.32
I use LMDE64 (tracking testing) and tracks this repo: deb http://www.duinsoft.nl/pkg debs all
The update is triggered by the package: update-sun-jre.
I find its use very convenient. All java links (Firefox 12, LibreOfice...) are updated too.
Web site and install info here: http://www.duinsoft.nl/packages.php?t=en
Added to my Giant sources.list under "Multimedia" section.
GeneC

Re: Howto install Oracle's Java on LMDE/Debian

Post by GeneC »

Nice find, Roger.

Thanks. :wink:

======================

Question.

I now have two Java's in Chrome 'plugins'
Do I disable the old one?
Or are they separate things.

Image
grizzler

Re: Howto install Oracle's Java on LMDE/Debian

Post by grizzler »

craigevil wrote:Added to my Giant sources.list under "Multimedia" section.
Really? Just curious, considering your posting of April 9. What made you change your mind?

By the way, a warning to everyone who uses the duinsoft script. Be prepared for an unexpected failure if Oracle ever fixes the text on the download page at java.com. They claim the file is self-extracting - it isn't.
Unfortunately, the script uses a sed scan on that page for the text "Linux (self-extracting" to find the url for the 32 bit package. If they ever change that part of the page, the script will fail (until it is fixed, of course).
grizzler

Re: Howto install Oracle's Java on LMDE/Debian

Post by grizzler »

GeneC wrote: I now have two Java's in Chrome 'plugins'
Do I disable the old one?
Or are they separate things.
The duinsoft script pulled in a different version and that was installed in /opt/java. If you used the method mentioned in the first posting in this thread to install 1.0.6_31, you should have another (slightly older) installation in /usr/lib/jvm. As that was installed from a deb, you should be able to remove it using dpkg.
Last edited by grizzler on Wed May 09, 2012 1:10 pm, edited 1 time in total.
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

grizzler wrote:
craigevil wrote:Added to my Giant sources.list under "Multimedia" section.
Really? Just curious, considering your posting of April 9. What made you change your mind?

By the way, a warning to everyone who uses the duinsoft script. Be prepared for an unexpected failure if Oracle ever fixes the text on the download page at java.com. They claim the file is self-extracting - it isn't.
Unfortunately, the script uses a sed scan on that page for the text "Linux (self-extracting" to find the url for the 32 bit package. If they ever change that part of the page, the script will fail (until it is fixed, of course).
meh figured what the hell. I don't use 99.99% of the repos on my list I just add them and try to keep them more or less updated. Actually trying to find someone that will mirror the list and maintain it, as I received bad news at doctor last week. Not sure how much longer I will be able to keep the list maintained.

My actual working sources.list is pretty basic. sid, exp, dmm, Google repos for Chrome and Google's Music manager, and Jitsi.

Code: Select all

$ inxi -r
Repos:     Active apt sources in file: /etc/apt/sources.list
           deb http://ftp.us.debian.org/debian/ unstable main contrib non-free                                               
           deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free                                           
           deb http://ftp.us.debian.org/debian/ experimental main contrib non-free                                           
           deb http://www.debian-multimedia.org/ unstable main non-free                                                      
           deb http://dl.google.com/linux/chrome/deb/ stable main                                                            
           deb http://dl.google.com/linux/musicmanager/deb/ stable main                                                      
           deb http://download.jitsi.org/deb/ unstable/               
GeneC

Re: Howto install Oracle's Java on LMDE/Debian

Post by GeneC »

grizzler

Thanks, that did it. :D

Code: Select all

Commit Log for Wed May  9 13:15:36 2012

Completely removed the following packages:
oracle-j2re1.6

Code: Select all

gene@zordon ~ $ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
grizzler

Re: Howto install Oracle's Java on LMDE/Debian

Post by grizzler »

craigevil wrote:Actually trying to find someone that will mirror the list and maintain it, as I received bad news at doctor last week.
Yeah, you mentioned that on fdn, if I remember correctly. I really hope you manage to beat that. I have a friend who is doing it. They gave him three months. Nearly two years ago.
CapitalG

Re: Howto install Oracle's Java on LMDE/Debian

Post by CapitalG »

roger64 wrote:Hi

Code: Select all

 java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Image

I have been offered the update this morning from 1.6.32
I use LMDE64 (tracking testing) and tracks this repo: deb http://www.duinsoft.nl/pkg debs all
The update is triggered by the package: update-sun-jre.
I find its use very convenient. All java links (Firefox 12, LibreOfice...) are updated too.
Web site and install info here: http://www.duinsoft.nl/packages.php?t=en
is this a safe source to download from?
äxl

Re: Howto install Oracle's Java on LMDE/Debian

Post by äxl »

At least someone should look at the binary. This sounds suspicious:
The downloaded package is a tarball (gzip compressed tar file) with a small unpack script tacked to the front (head -n 26 update-sun-jre.bin to see what that small script looks like). The tarball contains two files: the script itself and another tarball with support files (update-sun-jre-support.tar.gz). You should not unpack that support tarball, but leave it in the same directory as the script.
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

the update-sun-jre.bin

Code: Select all

#!/bin/sh

Tarball=$(tempfile)
Script=$(basename $0); Script=${Script%.bin}

tail -n +27 "$0" > $Tarball

if type sum >/dev/null; then
	if [ "$(sum $Tarball)" != "28224    19" ]; then
		echo 'Checksum error - unpack aborted!'
		rm -f $Tarball
		exit 1
	fi
else
	echo 'Unable to compare checksums (sum tool missing) - continuing anyway . . .'
fi

tar --extract --verbose --file $Tarball
rm -f $Tarball

echo "Files unpacked. Ready to run $Script (version 1.2.0) . . .\n"

if [ "$1" != "-x" ]; then
	sudo ./$Script -v install
fi
exit 0
That part looks like it does what it says.

wonders where the tarball that it mentions not extracting is ...........
grizzler

Re: Howto install Oracle's Java on LMDE/Debian

Post by grizzler »

The file update-sun-jre.bin is a tarball preceded by a small script (the one Craig showed in the posting above). If you run it with the -x switch, it will stop after unpacking the tarball part as the main script (update-sun-jre) and the support tarball (update-sun-jre-support.tar.gz). These will appear in the current directory. If you want to examine the support files, simply use tar or nautilus to unpack the support tarball in the current directory (it will create a 'usr' subdirectory with some more subdirectories and files) or look at the tarball with an archive manager like file-roller.

If you run the main script it will unpack the support tarball (ignoring anything you may have unpacked manually), placing the support files in the right place in the filing system structure. Running the script with the 'remove' command, should also remove the support files (but not anything you may have unpacked manually).
CapitalG

Re: Howto install Oracle's Java on LMDE/Debian

Post by CapitalG »

hmmm so sounds like there's not going to be a easy safe way to install it :lol:
craigevil

Re: Howto install Oracle's Java on LMDE/Debian

Post by craigevil »

Oracle Java7 , same steps as java 6

Code: Select all

fakeroot make-jpkg /home/craig/Downloads/java/jre-7u4-linux-i586.tar.gz

Code: Select all

dpkg -i oracle-j2re1.7_1.7.0+update4_i386.deb
Guess it helps when I bother to read the man page. :)

Then run update-alternatives per the first post in this thread.

Code: Select all

$ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode)
Locked

Return to “LMDE Archive”