HOW TO: Install Sun JRE Java on Linux Mint (script included)

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby sagirfahmid3 » Thu May 31, 2012 10:45 pm

Well, I didn't force people to use or install Oracle Java. It's a choice and people may follow it or not. Some like Oracle Java and some are fine with OpenJDK :mrgreen:

User avatar
hinto
Level 7
Level 7
Posts: 1654
Joined: Thu Jul 09, 2009 7:32 pm
Location: Cary NC, USA

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby hinto » Fri Jun 01, 2012 8:25 am

I know you didn't force anyone. I'm just curious to see if you found a difference.

At one time, the only option was to install java from Sun (and update alternatives). Then there was a package maintainer that created it in the nonfree area, but it lagged from the release from Sun. When Sun open sourced it, OpenJDK became basically the release implementation of java from Sun.

As far as I know the OpenJDK is pretty much the same as the one released from Sun. It has a relationship with Sun analogous to Fedora <-> Red Hat Enterprise or JBoss to JBoss Enterprise.

-Hinto
"In God we trust, all others bring data."- W. Edwards Deming

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby sagirfahmid3 » Fri Jun 01, 2012 10:43 am

Not really, no, I haven't found much difference between the two. It's a habit.
I like to think that Oracle Java is better since it's the original, and OpenJDK the derivative.

User avatar
hinto
Level 7
Level 7
Posts: 1654
Joined: Thu Jul 09, 2009 7:32 pm
Location: Cary NC, USA

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby hinto » Fri Jun 01, 2012 10:54 am

It's actually reversed now. OpenJDK is original and Sun's is the derivative.
-H
"In God we trust, all others bring data."- W. Edwards Deming

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby sagirfahmid3 » Thu Jun 14, 2012 12:20 pm

Hey guys, latest Java is out. Java 7 update 5. Script is still working MUAHHAHA :P
It should work for all the Java 7 updates. Also, I haven't added the parts in the script to remove previous versions of Java. You can do that manually without any ill-effects.

To remove previous versions of Java (thereby saving ~100MB disk space for each version removed), you can simply remove that version by opening your file manager as root and going into /opt/java/{32,64}/ and removing the previous versions. So what you do is, open a run dialog by pressing Alt+F2, then type in "gksu thunar/pcmanfm/nautilus" <--choose your default file manager. Then follow what I said above. So lets say you have Java 7 update 5 (latest) and you also have Java 7 update 4 (older), you can delete that folder that says Java7u4.

nostriluu
Level 1
Level 1
Posts: 1
Joined: Thu Jun 21, 2012 5:03 pm

Re: HOW TO: Install Sun Java on Linux Mint (script included!

Postby nostriluu » Thu Jun 21, 2012 5:04 pm

Can you please make it clear this thread is about the Java *****JRE*****. Many people want to install the JDK, where this thread is not helpful.

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Thu Jun 21, 2012 6:32 pm

Done. Thought I already had it in the title but guess not...

unkilbeeg
Level 1
Level 1
Posts: 34
Joined: Tue Apr 27, 2010 5:02 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby unkilbeeg » Tue Jun 26, 2012 6:36 pm

Just out of curiousity, why are you putting the plugin link in ~/.mozilla/plugins -- especially if you have more than one user. Go to each user's directory and modify their .mozilla/plugins directory? That's beating yourself to death.

Just put the link in /usr/lib/firefox/plugins and be done with it.

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Tue Jun 26, 2012 7:06 pm

Hmm, I'd rather not do that since I don't have the Firefox from the repository (so I don't HAVE a /usr/lib/firefox directory). I always get the official Firefox from mozilla.org as the firefoxes in the repositories are ALWAYS tainted with stupid mods put by the host Linux distro ( *cough* Mint Search Addon or search plugin mods *cough* ).

What I COULD do is prompt the user where they would like the plugin link (if they are the only user on that computer, or if it's a multi-user system).

unkilbeeg
Level 1
Level 1
Posts: 34
Joined: Tue Apr 27, 2010 5:02 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby unkilbeeg » Wed Jun 27, 2012 3:58 pm

OK, I can see that, although I suspect in the general case, most people using those instructions will probably just be using the repository version.

Even if you install the mozilla version, it's going to have a global place to put plugins. If you even have two users, it's simpler to put your plugins thre than in each user's home.

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Wed Jun 27, 2012 4:12 pm

Doesn't work like that. I tried it just now. Made a /usr/lib/firefox/plugins directory, and pointed the Java symlink to it.
Opened up Firefox, put in about:plugins and it's not there.

Like I said, I'll hafta make a prompt because your way doesn't work with the Firefox off Mozilla's site (manually installed).

grizzler
Level 5
Level 5
Posts: 594
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby grizzler » Thu Jun 28, 2012 2:59 am

sagirfahmid3 wrote:Like I said, I'll hafta make a prompt because your way doesn't work with the Firefox off Mozilla's site (manually installed).

Yes it does. I've used unkilbeeg's method for years with Mozilla's own Firefox. It works if you do it the proper way (i.e. using the alternatives system) and also if you simply create a link in /usr/lib/mozilla/plugins or /usr/lib/firefox/plugins.

User avatar
oobetimer
Level 7
Level 7
Posts: 1883
Joined: Tue Jun 01, 2010 12:53 pm
Location: Finland / above the Arctic Circle
Contact:

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby oobetimer » Thu Jun 28, 2012 6:07 am

grizzler wrote:
sagirfahmid3 wrote:Like I said, I'll hafta make a prompt because your way doesn't work with the Firefox off Mozilla's site (manually installed).

Yes it does. I've used unkilbeeg's method for years with Mozilla's own Firefox. It works if you do it the proper way (i.e. using the alternatives system) and also if you simply create a link in /usr/lib/mozilla/plugins or /usr/lib/firefox/plugins.


/usr/lib/mozilla/plugins should be enough.

Oracle Java setup in Ubuntu: http://www.youtube.com/watch?v=gSyGo_YVNf8&feature=plcp

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Thu Jun 28, 2012 6:11 am

Yep, /usr/lib/mozilla/plugins works for me here, but not the other one :?

SimonJ
Level 1
Level 1
Posts: 5
Joined: Thu Jul 12, 2012 5:49 am

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby SimonJ » Thu Jul 12, 2012 6:05 am

Hello, thanks for the tutorial!

I cannot get it to work, though. I' ve followed all your steps and it seems to be working, but in Firefox I cannot find the plugin. This is the output I get when running the script:

Code: Select all

Hi there. I hope you like this script. It is here to make life easier for those
who are having difficulty installing Java manually. As a noob myself at shell
scripting, I have kept this simple and straight forward to use.
Should you have any questions, or if the script fails to work,
please let me (sagirfahmid3) know. Also, feel free to improve upon this script
and don't forget to share it here!

Installation will now start. Do you want to proceed? (Y/N)
<Entering other keys will abort installation>Y
[sudo] password for simon:
mkdir: cannot create directory `java': File exists
mkdir: cannot create directory `64': File exists
Which UPDATE of Java version 7 are you installing? Type version # & press ENTER
This should be written on the tar.gz archive as jre7-u{#}-linux-x64.tar.gz
IMPORTANT NOTE: For Java updates between 4 to 9, please use 04,05...09 when prompted!
05
mv: cannot stat `/home/simon/jre1.7.0_05': No such file or directory
mkdir: cannot create directory `/home/simon/.mozilla/plugins': File exists
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package icedtea6-plugin is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
rm: cannot remove `/home/simon/.mozilla/plugins/libnpjp2.so': Permission denied
ln: failed to create symbolic link `/home/simon/.mozilla/plugins/libnpjp2.so': File exists
If the output below matches the version that you installed, all is well
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)
You can also check manually by opening Firefox and going to about:plugins
Yet another way to check your Java version is by going to http://www.java.com. Click 'Do I have Java?'


I've done it before so thats why the directories are already there. When running java -version I get this:

Code: Select all

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)


So Java seems to be insatlled properly. Only in firefox I don't see it in about:plugins. I'm kind of lost and I thought that maybe someone might know what the problem could be. Im running Mint 13.

Thanks,
Simon

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Thu Jul 12, 2012 8:54 pm

Do you have Iceweasel by any chance? Anything odd about your Firefox (like did you not install it, you just run it?)

grizzler
Level 5
Level 5
Posts: 594
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby grizzler » Fri Jul 13, 2012 3:30 am

Simon,
The line "rm: cannot remove `/home/simon/.mozilla/plugins/libnpjp2.so': Permission denied" suggests this particular item isn't owned by your user but by root. Use

Code: Select all

sudo rm ~/.mozilla/plugins/libnpjp2.so
to remove, check the ownership of the directories .mozilla and ./mozilla/plugins (should be 'simon') and create a new symlink with

Code: Select all

ln -s /opt/java/64/jre1.7.0_05/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

User avatar
sagirfahmid3
Level 6
Level 6
Posts: 1044
Joined: Sun Sep 04, 2011 12:39 pm

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby sagirfahmid3 » Fri Jul 13, 2012 10:57 am

^^ I didn't want to use root status when deleting files from the home folder; I thought it would be unnecessary, but ok, I'll put a "sudo" before the rm -rf.

SimonJ
Level 1
Level 1
Posts: 5
Joined: Thu Jul 12, 2012 5:49 am

Re: HOW TO: Install Sun JRE Java on Linux Mint (script inclu

Postby SimonJ » Fri Jul 13, 2012 1:34 pm

grizzler wrote:Simon,
The line "rm: cannot remove `/home/simon/.mozilla/plugins/libnpjp2.so': Permission denied" suggests this particular item isn't owned by your user but by root. Use

Code: Select all

sudo rm ~/.mozilla/plugins/libnpjp2.so
to remove, check the ownership of the directories .mozilla and ./mozilla/plugins (should be 'simon') and create a new symlink with

Code: Select all

ln -s /opt/java/64/jre1.7.0_05/lib/amd64/libnpjp2.so ~/.mozilla/plugins/


Thanks,
I changed the ownership of these directories to simion and created a new symlink but java still doesn't work in Firefox..

yurvol
Level 1
Level 1
Posts: 7
Joined: Fri Jul 13, 2012 4:20 pm

Mint's Version 6 Update 24 vs current 7 Update 5

Postby yurvol » Fri Jul 13, 2012 4:41 pm

So, how far actually behind is Mint 13/Ubuntu's OpenJDK from Oracle Java? Java.com says mine is: Version 6 Update 24
& current is: Version 7 Update 5 ?? Why the lag if it is open sourced?


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests