You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by fredand44 <fr...@hotmail.com> on 2011/12/14 07:55:32 UTC
How to set JAVA_HOME for maven?
Hello!
I have just reinstalled my computer to Ubuntu.
I have also installed maven 3.0.3..
I set JAVA_HOME in my .bashrc like:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export JAVA_HOME
If I print it out with printenv I get:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
But If I run mvn --version I get:
mvn --version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/fredrik/Applications/apache-maven-3.0.3
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
*Java home: /usr/lib/jvm/java-6-openjdk/jre*
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-14-generic", arch: "i386", family: "unix"
As you can see it points to the JRE, and I guess that is not right.
(I got the same when I did not set any JAVA_HOME also)
What do you think guys?
Best regards
Fredrik
--
View this message in context: http://maven.40175.n5.nabble.com/How-to-set-JAVA-HOME-for-maven-tp5073695p5073695.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to set JAVA_HOME for maven?
Posted by fredand44 <fr...@hotmail.com>.
Hello Guys!
Thanks for your replies!
I installed jdk 1.7
and reset the JAVA_HOME to that folder.
The output of mvn --version now give:
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/fredrik/Applications/apache-maven-3.0.3
Java version: 1.7.0_02, vendor: Oracle Corporation
Java home: /home/fredrik/Applications/jdk1.7.0_02/*jre*
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-14-generic", arch: "i386", family: "unix"
As I see it seems like maven adds the *jre*
Best regards
Fredrik
--
View this message in context: http://maven.40175.n5.nabble.com/How-to-set-JAVA-HOME-for-maven-tp5073695p5074397.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to set JAVA_HOME for maven?
Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Frederic,
fredand44 wrote:
> Hello!
>
> I have just reinstalled my computer to Ubuntu.
> I have also installed maven 3.0.3..
>
> I set JAVA_HOME in my .bashrc like:
>
> JAVA_HOME=/usr/lib/jvm/java-6-openjdk
> export JAVA_HOME
>
> If I print it out with printenv I get:
> JAVA_HOME=/usr/lib/jvm/java-6-openjdk
>
> But If I run mvn --version I get:
>
> mvn --version
> Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
> Maven home: /home/fredrik/Applications/apache-maven-3.0.3
> Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
> *Java home: /usr/lib/jvm/java-6-openjdk/jre*
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.0.0-14-generic", arch: "i386", family:
> "unix"
>
>
> As you can see it points to the JRE, and I guess that is not right.
This is normal.
> (I got the same when I did not set any JAVA_HOME also)
>
> What do you think guys?
Don't set JAVA_HOME yourself. I don't know Ubuntu, but I guess it sets this
variable on its own as other Linux systems (as mine) do anyway.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: How to set JAVA_HOME for maven?
Posted by Diego Lin <di...@synnex.com>.
Hi Fredrik,
Did you restart your computer or run the command, ". ~/.bashrc"?
If so, it's hardly possible. Remember to check there is no JAVA_HOME in
.bash_profile. Or show the content of .bashrc and .bash_profile in the
mail.
I still recommend you, use the standard JDK rather than openJdk.
By the way, Fedora 16 is very cool.
Thanks,
Diego
-----Original Message-----
From: fredand44 [mailto:fredand44@hotmail.com]
Sent: Wednesday, 14 December 2011 14:56
To: users@maven.apache.org
Subject: How to set JAVA_HOME for maven?
Hello!
I have just reinstalled my computer to Ubuntu.
I have also installed maven 3.0.3..
I set JAVA_HOME in my .bashrc like:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export JAVA_HOME
If I print it out with printenv I get:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
But If I run mvn --version I get:
mvn --version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home:
/home/fredrik/Applications/apache-maven-3.0.3
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
*Java home: /usr/lib/jvm/java-6-openjdk/jre* Default locale: en_US,
platform encoding: UTF-8 OS name: "linux", version: "3.0.0-14-generic",
arch: "i386", family: "unix"
As you can see it points to the JRE, and I guess that is not right.
(I got the same when I did not set any JAVA_HOME also)
What do you think guys?
Best regards
Fredrik
--
View this message in context:
http://maven.40175.n5.nabble.com/How-to-set-JAVA-HOME-for-maven-tp507369
5p5073695.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org