Upgrade Java in LMDE

Questions about applications and software
Forum rules
Before you post please read this

Upgrade Java in LMDE

Postby iainnitro on Thu Mar 01, 2012 9:37 am

Greetings:

I have installed LMDE (the latest version as of January 2012) and need to upgrade to Java 7 from the 6 that is with the system. I downloaded the Oracle tar.gz and installed it in my /usr/local/bin directory, made a symbolic link and set the JAVA_HOME environment variable in my .bash_profile. I went to try to set the update-java-alternatives and of course cannot set my java to the new installation. Basically I need to point my system to use the JDK located in /usr/local/bin/jdk (jdk is a sym link). Help would be much appreciated.

Thanks,
iainnitro
Level 1
Level 1
 
Posts: 3
Joined: Thu Mar 01, 2012 9:32 am

Linux Mint is funded by ads and donations.
 

Re: Upgrade Java in LMDE

Postby iainnitro on Thu Mar 01, 2012 2:34 pm

I think this can be marked SOLVED, but I welcome thoughts. I am not sure that this was the right way to go, however, it does seem to have worked!

Firstly, I had installed Java from Oracle from the .tar.gz file (this is for Java 7 which my current circumstances dictate that I run this version). I simply untarred the file into my /usr/local/bin/ directory. Then I made a symbolic link called jdk to use in the event that the version of Java is upgraded in the future.

Now the fun part. I decided to try to remove the Java 6 stuff in /usr/bin/ and replaced them with symbolic links to my new Java installation. This so far seems to be working.

For the archives, I removed the actual executables for Java 6 (rm java, javaws and javac) from /usr/bin/ and then linked symbolically to the files in my /usr/local/bin/jdk (jdk is a sym link as well to jdk1.7.0_03 (which is the real directory)). The new sym-links from /usr/bin/ point to the executables in the /usr/local/bin/jdk directory.

Hope this makes sense. It does however, short-circuit the update-alternatives stuff -- just as a precautionary note!
iainnitro
Level 1
Level 1
 
Posts: 3
Joined: Thu Mar 01, 2012 9:32 am

Re: Upgrade Java in LMDE

Postby xenopeek on Thu Mar 01, 2012 5:50 pm

Moved here by moderator
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14890
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Upgrade Java in LMDE

Postby iainnitro on Fri Mar 02, 2012 8:27 am

In my continuing effort to help others with needs like mine, I needed to do a quick update to let everyone know that I forgot a step in transitioning to Java 7, making sure my browser plugins were up to date.

For Firefox, in is just a matter of deleting the previous sym-link in the plugins directory (/usr/lib/mozilla/plugins/) and making a new link to the <jre>/lib/<platform>/libnpjp2.so file.

<plaform> is your architecture (in my case amd64).

For Chromium, I just needed to go into the plugins manager inside the browser and disable the old version plugin and the new one was already also installed. Very nice.

At this point, the system is working well and reporting the correct Java version in all places, eg inside the browser and the terminal and the Java programs are running fine. Again, for those of you playing the home game -- My method for getting to Java 7 goes around the mechanism (update-alternatives) and so it may not be the best solution... I welcome doing this the right way as everything on my system is a sym-link and so it is fully reversible if need be. (Other than I deleted the actual executables for Java 6).
iainnitro
Level 1
Level 1
 
Posts: 3
Joined: Thu Mar 01, 2012 9:32 am


Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 4 guests