I’m trying to run my maven project with mvn jetty:run which is giving me
Unable to locate the Javac Compiler in:
/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
So apparently the jdk jre cannot be found? I do have java-1_6_0-openjdk installed, and if it’s anything like windows I suspect I need to set JAVA_HOME to /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java
But how do I do this? Or if this isn’t the solution, what is?
you could check where it realy is by using YaST > Software > Software Management, then search for the (installed) package and use the “Filelist” tab lower-right (scroll to the bold part, that is where the executables are).
one exports this to the environment of the current process (thus that it will be also available in chikd processes like the statements you type later in the same shell session) with
The idea was that with my point 1) you should find out what the real path is and in 2) I used just a path (I think the one you guessed) as an example to show how environment variables work.
But I think you got the idea.
For maven at the very least it seems to be needed, basically I got an error about it not being able to find it in some /bin/bin path, so I cut the path off short - just before the /bin.
So
Basically got everything working as I wanted to now, all of this was to use Hudson to able be to remotely checkout an application from svn and build it.
>
> Basically got everything working as I wanted to now, all of this was to
> use ’ Hudson’ (http://hudson-ci.org/) to able be to remotely checkout an
> application from svn and build it.
>
Since it works for you this is ok.
I just want to point at the fact that the JAVA_HOME variable never includes
a part in its path that points to the jre within the jdk but to the root of
the jdk. Of course this also makes sense since the javac and the other
development tools are in
/usr/lib64/jvm/java-1.6.0-sun-1.6.0/bin/
and not in something like
/usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre/bin/
so I wonder a bit how with that setting for JAVA_HOME your system is able to
find the javac compiler.
–
openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram