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 mintybits on Mon May 28, 2012 9:44 am

äxl wrote:mintybits, I don't want to teach you but maybe you could give this a read: http://www.gnu.org/philosophy/free-sw.html

Thanks. I read as far as this before gagging :wink: :
When users don't control the program, the program controls the users. The developer controls the program, and through it controls the users. This nonfree or “proprietary” program is therefore an instrument of unjust power.

I think the only crusade linux folks should engage in is pursuit of the best software (functionality & reliability). I favour Oracle Java as the Mint default because it is the best.
mintybits
Level 5
Level 5
 
Posts: 827
Joined: Fri Jan 27, 2012 5:09 pm

Linux Mint is funded by ads and donations.
 

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

Postby äxl on Mon May 28, 2012 10:10 am

mintybits wrote:Thanks. I read as far as this before gagging :wink: :

I don't know what's to gag about the freedom of choice?
I think the only crusade linux folks should engage in is pursuit of the best software (functionality & reliability). I favour Oracle Java as the Mint default because it is the best.

And btw: You're crusading. ;)
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 Mon May 28, 2012 2:36 pm

äxl wrote:I guess I can remove whatever I want because I still have Gnome and Cinnamon installed (although not using them).
Depends on what is more important for you, craigevil. "Half of Gnome" or an insecure OpenJDK. ;)
From stability and performance point of view I can't notice a difference between Oracle and Open.


Openjdk6 is not insecure if it was it would not be in the Debian repos. Just like sun-java-6 is still in the Stable Debian repo because it is patched. And Gnome is a steaming pile of manure I would never install it.

As for the person complaining that Oracle's Java is not in the Mint/LMDE repos, Oracle's license does not permit redistribution. If you want Oracle's java you must go to their website and download it. Even the almighty Ubuntu had to remove it from their repos.

I would also suggest you read:
Open-source software - Wikipedia, the free encyclopedia - https://en.wikipedia.org/wiki/Open-source_software
Debian Social Contract - http://www.debian.org/social_contract#guidelines
OpenJDK FAQ - http://openjdk.java.net/faq/

There is a big difference between free to use and 'free'.
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 mintybits on Mon May 28, 2012 2:59 pm

craigevil wrote:As for the person complaining that Oracle's Java is not in the Mint/LMDE repos, Oracle's license does not permit redistribution. If you want Oracle's java you must go to their website and download it. Even the almighty Ubuntu had to remove it from their repos.

I think that was me. It's fair enough if Oracle's license prevents it. Does this extend to not making it an option in the Software Manager? Or at least having a downloadable installer that makes you tick the license agreement before it installs, like Windows does? I do not understand why Windows manages Oracle Java installation and updates seemlessly but Ubuntu/Mint does not.
mintybits
Level 5
Level 5
 
Posts: 827
Joined: Fri Jan 27, 2012 5:09 pm

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

Postby craigevil on Tue Jun 12, 2012 3:36 pm

Oracle released updated versions of both Java 6 and Java 7. Please download and install the new versions as they patched several security holes.

$ java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) Client VM (build 23.1-b03, 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

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

Postby zerozero on Tue Jul 03, 2012 8:49 pm

Code: Select all
deb-kde zerozero # dpkg -i oracle-j2re1.7_1.7.0+update5_amd64.deb
(Reading database ... 138319 files and directories currently installed.)
Preparing to replace oracle-j2re1.7 1.7.0+update4 (using oracle-j2re1.7_1.7.0+update5_amd64.deb) ...
Unpacking replacement oracle-j2re1.7 ...
Setting up oracle-j2re1.7 (1.7.0+update5) ...
deb-kde zerozero # update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
* 1            /usr/lib/jvm/j2re1.7-oracle/bin/java             316       manual mode
  2            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode

Press enter to keep the current choice[*], or type selection number:
deb-kde zerozero # update-alternatives --config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                              Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      auto mode
* 1            /usr/lib/jvm/j2re1.7-oracle/bin/javaws             316       manual mode
  2            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      manual mode

Press enter to keep the current choice[*], or type selection number:
deb-kde zerozero # update-alternatives --config javac
update-alternatives: error: no alternatives for javac.
deb-kde zerozero # exit
exit
zerozero@deb-kde ~ $ java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
zerozero@deb-kde ~ $
zerozero
Level 16
Level 16
 
Posts: 6467
Joined: Tue Jul 07, 2009 2:29 pm

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

Postby craigevil on Wed Jul 04, 2012 2:14 am

Code: Select all
# update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
* 1            /usr/lib/jvm/j2re1.7-oracle/bin/java            316       manual mode
  2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode

Press enter to keep the current choice[*], or type selection number:


$ java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode)

Firefox about:plugins
Java(TM) Plug-in 1.7.0_05
File: /usr/lib/jvm/j2re1.7-oracle/lib/i386/libnpjp2.so
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 jasmineaura on Mon Oct 15, 2012 3:45 am

Very nice. Thank you for this Craig. :D

If I could add, though, the `update-alternatives --config javac` probably isn't really needed. As javac is the java compiler -- part of the Sun/oracle or the Open -jdk -- isn't at all related to any of the security vulnerabilities, because these affect the JRE -- Java Runtime Environment.

Sticking with the tried JRE6, at least till next year :D

Code: Select all
$ java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)
User avatar
jasmineaura
Level 2
Level 2
 
Posts: 60
Joined: Thu Mar 08, 2012 3:38 am
Location: Cairo, Egypt

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

Postby mockturtl on Sun Jan 06, 2013 5:24 pm

UPDATE: 2013-01-14: Do not install 7u10. See the following post.

Code: Select all
$ fakeroot make-jpkg jre-7u10-linux-x64.tar.gz
...
No matching plugin was found.

With 7u10 [or higher], you need to edit /usr/share/java-package/oracle-j2re.sh (and/or oracle-j2sdk.sh, if you have the jdk).

The scripts are hard-coded to deal with a single-digit update number. Following the other examples, we'll... hard-code them to two digits. :-/ Should be future-proof, anyway. (Edit: ah, this resurrects #597294 from 2010, and is fixed in experimental.)

Insert a second [0-9], for both 32-bit and 64-bit cases, and change the ${archive_name} slice to 6:2
(in the filename, startIndex:length, so jre-7u10).
Code: Select all
# in oracle-j2re.sh

15   "jre-7u"[0-9][0-9]"-linux-i586.tar.gz") # SUPPORTED
16       j2se_version=1.7.0+update${archive_name:6:2}${revision}
...
31   "jre-7u"[0-9][0-9]"-linux-x64.tar.gz") # SUPPORTED
32       j2se_version=1.7.0+update${archive_name:6:2}${revision}

# similarly "jdk-7u" in oracle-j2sdk.sh

Now it works:
Code: Select all
$ fakeroot make-jpkg jdk-7u10-linux-x64.tar.gz
...
Detected product:
    Java(TM) Development Kit (JDK)
    Standard Edition, Version 1.7.0+update10
    Oracle(TM), Inc.
Is this correct [Y/n]: y
...
The Debian package has been created in the current directory. You can
install the package as root (e.g. dpkg -i oracle-j2sdk1.7_1.7.0+update10_amd64.deb).

Install and update-alternatives as above.
Code: Select all
$ java -version
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Last edited by mockturtl on Tue Jan 15, 2013 9:40 pm, edited 3 times in total.
Image
User avatar
mockturtl
Level 4
Level 4
 
Posts: 437
Joined: Sat Oct 09, 2010 8:51 pm

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

Postby mockturtl on Mon Jan 14, 2013 12:26 pm

Image
User avatar
mockturtl
Level 4
Level 4
 
Posts: 437
Joined: Sat Oct 09, 2010 8:51 pm

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

Postby mockturtl on Fri Feb 01, 2013 4:52 pm

yet another CRITICAL SECURITY UPDATE: 7u13
"And why not?"

(thanks bigj231)
Image
User avatar
mockturtl
Level 4
Level 4
 
Posts: 437
Joined: Sat Oct 09, 2010 8:51 pm

Linux Mint is funded by ads and donations.
 
Previous

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 3 guests