Howto install Oracle's Java on LMDE/Debian

Write tutorials and howtos in here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

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

Postby äxl on Mon Apr 16, 2012 1:57 pm

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.
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.
User avatar
äxl
Level 5
Level 5
 
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

Linux Mint is funded by ads and donations.
 

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

Postby mintyed on Mon Apr 16, 2012 6:02 pm

ä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.
Enjoy It
Linux is many things to many people.
If you use it and it fits your needs enjoy it.
User avatar
mintyed
Level 2
Level 2
 
Posts: 89
Joined: Mon Mar 16, 2009 1:58 am

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

Postby äxl on Sat May 05, 2012 8:41 am

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.
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.
User avatar
äxl
Level 5
Level 5
 
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

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

Postby craigevil on Sat May 05, 2012 12:26 pm

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.
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

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

Postby äxl on Sat May 05, 2012 3:20 pm

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 ...
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.
User avatar
äxl
Level 5
Level 5
 
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

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

Postby craigevil on Sat May 05, 2012 5:37 pm

ä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.
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

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

Postby roger64 on Wed May 09, 2012 3:43 am

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
roger64
Level 4
Level 4
 
Posts: 260
Joined: Wed Jun 01, 2011 5:48 am

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

Postby craigevil on Wed May 09, 2012 11:29 am

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.
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

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

Postby GeneC on Wed May 09, 2012 12:30 pm

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
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1460
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

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

Postby grizzler on Wed May 09, 2012 1:02 pm

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
Level 4
Level 4
 
Posts: 399
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

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

Postby grizzler on Wed May 09, 2012 1:08 pm

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.
grizzler
Level 4
Level 4
 
Posts: 399
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

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

Postby craigevil on Wed May 09, 2012 1:09 pm

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/               
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

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

Postby GeneC on Wed May 09, 2012 1:21 pm

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)
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1460
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

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

Postby grizzler on Wed May 09, 2012 1:23 pm

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.
grizzler
Level 4
Level 4
 
Posts: 399
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

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

Postby CapitalG on Wed May 09, 2012 5:03 pm

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?
User avatar
CapitalG
Level 3
Level 3
 
Posts: 103
Joined: Wed Sep 21, 2011 4:02 am

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

Postby äxl on Wed May 09, 2012 5:13 pm

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.
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.
User avatar
äxl
Level 5
Level 5
 
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

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

Postby craigevil on Wed May 09, 2012 7:14 pm

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 ...........
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

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

Postby grizzler on Thu May 10, 2012 3:14 am

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).
grizzler
Level 4
Level 4
 
Posts: 399
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

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

Postby CapitalG on Thu May 10, 2012 8:19 pm

hmmm so sounds like there's not going to be a easy safe way to install it :lol:
User avatar
CapitalG
Level 3
Level 3
 
Posts: 103
Joined: Wed Sep 21, 2011 4:02 am

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

Postby craigevil on Thu May 10, 2012 8:48 pm

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)
Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

Linux Mint is funded by ads and donations.
 
PreviousNext

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 2 guests