> What's the deal, haven't I set JAVA_HOME correctly?
Doesn't matter, as long...
> thufir@dur:~$
> thufir@dur:~$ sudo Desktop/james-2.3.2/bin/run.sh
> ERROR: JAVA_HOME not found in your environment.
>
> Please, set the JAVA_HOME variable in your environment to match the
> location of the Java Virtual Machine you want to use.
...as you use sudo this way, where by default the environment gets reset.
--
Regards
mks
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-17-2012, 03:14 PM
Colin Law
JAVA_HOME
On 17 August 2012 10:14, Thufir <hawat.thufir@gmail.com> wrote:
> What's the deal, haven't I set JAVA_HOME correctly?
>
> thufir@dur:~$
> thufir@dur:~$ sudo Desktop/james-2.3.2/bin/run.sh
> ERROR: JAVA_HOME not found in your environment.
>
> Please, set the JAVA_HOME variable in your environment to match the
> location of the Java Virtual Machine you want to use.
> thufir@dur:~$
> thufir@dur:~$ echo $JAVA_HOME
Try sudo echo $JAVA_HOME
Colin
> /usr/lib/jvm/java-6-openjdk-common
> thufir@dur:~$
> thufir@dur:~$ ll /usr/lib/jvm/
> total 104
> drwxr-xr-x 6 root root 4096 Aug 16 00:41 ./
> drwxr-xr-x 242 root root 73728 Aug 16 23:55 ../
> lrwxrwxrwx 1 root root 19 Apr 12 18:57 java-1.6.0-openjdk-i386 ->
> java-6-openjdk-i386/
> -rw-r--r-- 1 root root 2345 Apr 12 18:57 .java-1.6.0-openjdk-i386.jinfo
> drwxr-xr-x 3 root root 4096 Aug 16 00:41 java-6-openjdk-common/
> drwxr-xr-x 5 root root 4096 Aug 16 00:41 java-6-openjdk-i386/
> drwxr-xr-x 5 root root 4096 Aug 16 00:41 java-7-openjdk-i386/
> drwxr-xr-x 8 root root 4096 Aug 14 11:14 java-7-oracle/
> -rw-r--r-- 1 root root 2564 Aug 14 11:14 .java-7-oracle.jinfo
> thufir@dur:~$
> thufir@dur:~$ sudo update-alternatives --config java
> There are 3 choices for the alternative java (providing /usr/bin/java).
>
> Selection Path Priority
> Status
> ------------------------------------------------------------
> 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1063
> auto mode
> * 1 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061
> manual mode
> 2 /usr/lib/jvm/java-7-oracle/bin/java 1062
> manual mode
> 3 /usr/lib/jvm/java-7-oracle/jre/bin/java 1063
> manual mode
>
> Press enter to keep the current choice[*], or type selection number:
> thufir@dur:~$
> thufir@dur:~$ java -version
> java version "1.6.0_24"
> OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2)
> OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
> thufir@dur:~$
>
>
>
> see:
>
> http://askubuntu.com/questions/175514/how-to-set-java-home-for-openjdk
>
>
>
> thanks,
>
> Thufir
>
>
> --
> ubuntu-users mailing list
> ubuntu-users@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-17-2012, 03:39 PM
Markus Schönhaber
JAVA_HOME
17.08.2012 17:14, Colin Law:
> On 17 August 2012 10:14, Thufir <hawat.thufir@gmail.com> wrote:
>> What's the deal, haven't I set JAVA_HOME correctly?
>>
>> thufir@dur:~$
>> thufir@dur:~$ sudo Desktop/james-2.3.2/bin/run.sh
>> ERROR: JAVA_HOME not found in your environment.
>>
>> Please, set the JAVA_HOME variable in your environment to match the
>> location of the Java Virtual Machine you want to use.
>> thufir@dur:~$
>> thufir@dur:~$ echo $JAVA_HOME
>
> Try sudo echo $JAVA_HOME
Why?
That will show the same as
echo $JAVA_HOME
since bash will apply variable expansion before it calls sudo.
--
Regards
mks
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-17-2012, 04:07 PM
Colin Law
JAVA_HOME
On 17 August 2012 16:39, Markus Schönhaber
<ubuntu-users@list-post.mks-mail.de> wrote:
> 17.08.2012 17:14, Colin Law:
>
>> On 17 August 2012 10:14, Thufir <hawat.thufir@gmail.com> wrote:
>>> What's the deal, haven't I set JAVA_HOME correctly?
>>>
>>> thufir@dur:~$
>>> thufir@dur:~$ sudo Desktop/james-2.3.2/bin/run.sh
>>> ERROR: JAVA_HOME not found in your environment.
>>>
>>> Please, set the JAVA_HOME variable in your environment to match the
>>> location of the Java Virtual Machine you want to use.
>>> thufir@dur:~$
>>> thufir@dur:~$ echo $JAVA_HOME
>>
>> Try sudo echo $JAVA_HOME
>
> Why?
Because then you will learn a lot because someone will point out how
stupid you are to even try that.
To the OP,
sudo sh -c 'echo $JAVA_HOME'
might be more informative. Or am I still being stupid?
Colin
> That will show the same as
> echo $JAVA_HOME
> since bash will apply variable expansion before it calls sudo.
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-18-2012, 04:33 PM
Thufir
JAVA_HOME
On Fri, 17 Aug 2012 17:07:21 +0100, Colin Law wrote:
> To the OP,
> sudo sh -c 'echo $JAVA_HOME'
> might be more informative.
thufir@dur:~$
thufir@dur:~$ ls /usr/lib/jvm/java-6-openjdk-common
jre
thufir@dur:~$ sudo sh -c 'echo $JAVA_HOME'
[sudo] password for thufir:
thufir@dur:~$
thufir@dur:~$ sudo sh -c 'echo $JAVA_HOME'
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-18-2012, 07:26 PM
Colin Law
JAVA_HOME
On 18 August 2012 17:33, Thufir <hawat.thufir@gmail.com> wrote:
> On Fri, 17 Aug 2012 17:07:21 +0100, Colin Law wrote:
>
>> To the OP,
>> sudo sh -c 'echo $JAVA_HOME'
>> might be more informative.
>
>
> thufir@dur:~$
> thufir@dur:~$ ls /usr/lib/jvm/java-6-openjdk-common
> jre
> thufir@dur:~$ sudo sh -c 'echo $JAVA_HOME'
> [sudo] password for thufir:
>
> thufir@dur:~$
> thufir@dur:~$ sudo sh -c 'echo $JAVA_HOME'
>
> thufir@dur:~$
> thufir@dur:~$ cat /etc/environment
> PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/
> games"
> JAVA_HOME="/usr/lib/jvm/java-6-openjdk-common"
> thufir@dur:~$
Are you ok now or do you not see what the issue is? When you use sudo
you get root's environment not the current user. You could use sudo
su instead, which gives you root privileges but the users environment
(I think).
Colin
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
08-18-2012, 09:24 PM
Thufir
JAVA_HOME
On Sat, 18 Aug 2012 20:26:43 +0100, Colin Law wrote:
> Are you ok now or do you not see what the issue is? When you use sudo
> you get root's environment not the current user. You could use sudo su
> instead, which gives you root privileges but the users environment (I
> think).
I found that "sudo su -" gives me root, and I'm able to echo $JAVA_HOME.
However, what should it be set to? It seems to be asking for a binary.