You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrew Hughes <ah...@gmail.com> on 2010/02/01 02:00:41 UTC

Problem with JAVA_HOME relative path

Hi All,

I get the following error and I'm pretty sure that the problem is hidden
somewhere. Things of interest are in *bold* below

[INFO] Compiling 16 source files to
D:\Workspace\gwt1.6-maven2-starter-app-1.0\server\target\classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jdk1.6.0_14\*..\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.

[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Feb 01 10:09:48 CST 2010
[INFO] Final Memory: 12M/25M
[INFO]
------------------------------------------------------------------------

D:\Workspace\gwt1.6-maven2-starter-app-1.0\parent>*echo %JAVA_HOME%*
*C:\Program Files\Java\jdk1.6.0_14*
*
*

My JAVA_HOME appears to be set correctly, pointing to jdk1.6.0_14. However,
the compiler plugin is looking for ..\lib\tools.jar. Which does not exist,
because the ".." (up one directory) path is actually pointing to 'C:\Program
Files\Java\lib\tools.jar' which is obviously wrong.

Any idea's where the relative path could be getting trashed?

Cheers :)

p.s. to get the source for the code I am trying to build:
svn checkout *http*://gwt-maven2-starter-app.googlecode.com/svn/trunk/gwt-maven2-starter-app-read-only

Re: Problem with JAVA_HOME relative path

Posted by Andrew Hughes <ah...@gmail.com>.
1. Fixed on Command line... I am not happy with this and don't understand
how it works!
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_14*\jre*

2. Eclipse DOES fail with the error you mentioned above.... But is now
fixed!
External JRE Window -> Preferences -> .... as described in the FAQ link you
send.


THANKS HEAPS Brett :)


On Mon, Feb 1, 2010 at 1:30 PM, Brett Randall <ja...@gmail.com> wrote:

> Are you running Eclipse IDE?  Looks similar to
>
> http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-UnabletolocatetheJavacCompilerError
>
>
> Brett
>
> On Mon, Feb 1, 2010 at 12:00 PM, Andrew Hughes <ah...@gmail.com> wrote:
>
> > Hi All,
> >
> > I get the following error and I'm pretty sure that the problem is hidden
> > somewhere. Things of interest are in *bold* below
> >
> > [INFO] Compiling 16 source files to
> > D:\Workspace\gwt1.6-maven2-starter-app-1.0\server\target\classes
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD FAILURE
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Compilation failure
> > Unable to locate the Javac Compiler in:
> >  C:\Program Files\Java\jdk1.6.0_14\*..\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.
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 2 seconds
> > [INFO] Finished at: Mon Feb 01 10:09:48 CST 2010
> > [INFO] Final Memory: 12M/25M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> > D:\Workspace\gwt1.6-maven2-starter-app-1.0\parent>*echo %JAVA_HOME%*
> > *C:\Program Files\Java\jdk1.6.0_14*
> > *
> > *
> >
> > My JAVA_HOME appears to be set correctly, pointing to jdk1.6.0_14.
> However,
> > the compiler plugin is looking for ..\lib\tools.jar. Which does not
> exist,
> > because the ".." (up one directory) path is actually pointing to
> > 'C:\Program
> > Files\Java\lib\tools.jar' which is obviously wrong.
> >
> > Any idea's where the relative path could be getting trashed?
> >
> > Cheers :)
> >
> > p.s. to get the source for the code I am trying to build:
> > svn checkout *http*://
> >
> gwt-maven2-starter-app.googlecode.com/svn/trunk/gwt-maven2-starter-app-read-only
> >
>

Re: Problem with JAVA_HOME relative path

Posted by Brett Randall <ja...@gmail.com>.
Are you running Eclipse IDE?  Looks similar to
http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-UnabletolocatetheJavacCompilerError


Brett

On Mon, Feb 1, 2010 at 12:00 PM, Andrew Hughes <ah...@gmail.com> wrote:

> Hi All,
>
> I get the following error and I'm pretty sure that the problem is hidden
> somewhere. Things of interest are in *bold* below
>
> [INFO] Compiling 16 source files to
> D:\Workspace\gwt1.6-maven2-starter-app-1.0\server\target\classes
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compilation failure
> Unable to locate the Javac Compiler in:
>  C:\Program Files\Java\jdk1.6.0_14\*..\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.
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Mon Feb 01 10:09:48 CST 2010
> [INFO] Final Memory: 12M/25M
> [INFO]
> ------------------------------------------------------------------------
>
> D:\Workspace\gwt1.6-maven2-starter-app-1.0\parent>*echo %JAVA_HOME%*
> *C:\Program Files\Java\jdk1.6.0_14*
> *
> *
>
> My JAVA_HOME appears to be set correctly, pointing to jdk1.6.0_14. However,
> the compiler plugin is looking for ..\lib\tools.jar. Which does not exist,
> because the ".." (up one directory) path is actually pointing to
> 'C:\Program
> Files\Java\lib\tools.jar' which is obviously wrong.
>
> Any idea's where the relative path could be getting trashed?
>
> Cheers :)
>
> p.s. to get the source for the code I am trying to build:
> svn checkout *http*://
> gwt-maven2-starter-app.googlecode.com/svn/trunk/gwt-maven2-starter-app-read-only
>