Upgrade Java in LMDE

Archived topics about LMDE 1 and LMDE 2
Locked
iainnitro

Upgrade Java in LMDE

Post by iainnitro »

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,
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
iainnitro

Re: Upgrade Java in LMDE

Post by iainnitro »

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!
User avatar
xenopeek
Level 25
Level 25
Posts: 29459
Joined: Wed Jul 06, 2011 3:58 am

Re: Upgrade Java in LMDE

Post by xenopeek »

Moved here by moderator
Image
iainnitro

Re: Upgrade Java in LMDE

Post by iainnitro »

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).
Locked

Return to “LMDE Archive”