[ale] AARG! Manual software updates, Sun Java, LibreOffice, help

Michael Hirsch mdhirsch at gmail.com
Wed Nov 9 13:42:08 EST 2011


On Sat, Nov 5, 2011 at 4:33 PM, Ron Frazier
<atllinuxenthinfo at c3energy.com>wrote:

> I just finished spending an hour reading through a 14 PAGE printed howto
> document telling me how to uninstall old Sun Java from Ubuntu and
> reinstall the new version and how to do the same thing EVERY time there
> is an update. ( If you're interested, here's the procedure:
> https://sites.google.com/site/easylinuxtipsproject/java ) While I
> appreciate the publisher of the web page making this available, my
> general response is YOU GOTTA BE KIDDING! Now I get to spend HALF an
> HOUR on EVERY COMPUTER updating Java EVERY TIME there is an UPDATE!!!
>

Ye gods!  I hadn't read that.  Yes, that is a long set of commands.  Of
course most of them are scriptable, but still...  And then there is the
fact that they don't really appear to work.  Following them will give you
the proper java, but not the proper javac, javaws, jexec, keytool, etc.  I
appear to have 30 files in /etc/alternatives related to java, and those
instructions seem to fix only one of them.

The update-alternatives and update-java-alternatives do seem to have the
capability to link all 30 of those files to the right places, but I've
never gotten it to work.  So I've given up on it.  Too bad.

Here's what works for me.  It takes about 5 minutes the first time, then
only a minute or so subsequently, not counting download time:

Download the jdk from oracle and install it in /opt, or if you prefer
/opt/java.  So inside my /opt I have
jdk1.4.2_19
jdk1.5.0_22
jdk1.6.0_22
jdk1.6.0_23
jdk1.6.0_24
jdk1.6.0_27
jdk1.7.0

Now (as root) edit /etc/profile.d/java.sh and make it read (but correct the
version):

export JDK_HOME=/opt/jdk1.6.0_27
export JAVA_HOME=/opt/jdk1.6.0_27
PATH=${JDK_HOME}/bin:$PATH

Note that the file does not need to be executable.

For bonus points, add the mozilla plugin:

ls -lf /opt/jdk1.6.0_27/jre/lib/amd64/libnpjp2.so
/usr/lib/mozilla/plugins/libjavaplugin.so

This will setup java for anyone who logs in and uses a sh-compatible shell
(including bash, of course).

You might have to go around deleting old versions of the java plugin if one
is installed somewhere else.

Now if you have multiple versions installed, you can globally switch them
by editing one file.  You need to restart your shell to have it take
effect.  You can also run '. /etc/profile.d/java.sh' in a shell to point to
whichever java it points to.  Copying that file to a personal directory
makes it easy to edit and switch your java without affecting your users.

Hope that helps,

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20111109/eabd3f65/attachment.html 


More information about the Ale mailing list