JAVA_HOME defined but maven2 compains it could not find it

Tapas Mishra mightydreams at gmail.com
Fri Oct 22 16:04:12 UTC 2010


On Fri, Oct 22, 2010 at 8:04 PM, Alan Pope <alan at popey.com> wrote:
> On 22 October 2010 15:15, Tapas Mishra <mightydreams at gmail.com> wrote:
>> Ok I read the link you gave and also man page of update-alternatives
>> excerpts from your link
>> "update-alternatives --config java"
>> I could not understand how to do so.
>> My usual way to do so would be to add $JAVA_HOME before /usr/bin in
>> $PATH in /etc/profile
>> but I feel there should be an elegant way to do so.
>> I have created a symbolic link so now
>> ls -l /usr/bin/java
>> lrwxrwxrwx 1 root root 41 2010-10-20 16:36 /usr/bin/java ->
>> /usr/lib/jvm/java-6-sun-1.6.0.20/bin/java
>> is this correct.
>
> I don't think you needed to update anything. /usr/bin/java points to
> /etc/alternatives/java
No this is not the case.
>which (probably) points to
> /usr/lib/jvm/java-6-sun-1.6.0.20/bin/java, if it doesn't then you
> follow the steps. E.g.
>
> First list the java packages installed..
> alan at hactar:~$ sudo update-java-alternatives -l
> java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
This gives me only one output
update-java-alternatives -l
java-6-sun 63 /usr/lib/jvm/java-6-sun
does that mean I have only one Java installed.

> (I only have one)
>
> Then point java alternatives to it.
> alan at hactar:~$ sudo update-java-alternatives -s java-6-openjdk
>
> Doing a direct link from /usr/bin/java to somewhere will work, but
> possibly break when a different version of java is installed later.
Ok.




More information about the ubuntu-users mailing list