[ubuntu-za] Installing Java on 8.04 LTS

Louis van der Merwe themandibleclaw at gmail.com
Thu Jan 15 08:15:49 GMT 2009


2009/1/15 Alf Stockton <alf at stockton.co.za>

> With a view to installing TRAC+, which is a Java application, on a 8.04 LTS
> system I have run "apt-get install sun-Java5-bin" but when it gets to
> actually
> installing TRAC+ and issuing the command
> "$JAVA_HOME/bin/jar -xvf track-361.war"
> in the appropriate directory I get an error:-
>  -bash: /bin/jar: No such file or directory
> I have obviously got the installation of Java wrong but where?
>
> --
> Regards,
> Alf Stockton            www.stockton.co.za
>
> You look tired.
>
> --
> ubuntu-za mailing list
> ubuntu-za at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-za
>



Hi Alf,

Due to sun's license on java, linux distributions ship with a GNU version of
java (gcj).
under /etc/alternatives, you will find symbolic links pointing some of the
java components (java, javac, jar, ect ...)
to gcj. You installed sun-java correctly, but you're missing a step.

after running apt-get install sun-java5-bin, you need to update your java
alternatives (/etc/alternatives).
You need to use a tool called update-java-alternatives.

run `update-java-alternatives -l` to get a list of all the java versions
installed.
then run `update-java-alternatives {java-version}` to relink to the correct
java installation.

`which jar` should now point to the jar binary for java 5

cheers

Louis


btw - jar is the java archive tool. it is used to package and unpackage jar,
war and ear files (effectively zip files with a manifest and a different
extention).

give me a shout if you don't come right.

also, if you run your app and get a message like "incorrect major minor
version", it means that your application was compiled on a different version
of java to the one you've installed, so as james suggested, you might want
to try installing java6 and then updating your alternatives agin.


regards

Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-za/attachments/20090115/7ff45116/attachment.htm 


More information about the ubuntu-za mailing list