Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IAM (Eclipse Integration for Apache Maven) » IAM looking for Java tools in wrong place?
IAM looking for Java tools in wrong place? [message #19032] Thu, 21 May 2009 04:48 Go to next message
BenH is currently offline BenHFriend
Messages: 39
Registered: July 2009
Member
An error has started today whenever I try to do a Maven build:

"Unable to locate the Javac Compiler in:C:\Program
Files\Java\jre6\..\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"

The relevant project's JRE is pointing at a valid JDK 1.5 install.

Machine wide JAVA_HOME is set to C:\Program Files\Java\jdk1.6.0_06\bin

Both contain tools.jar. I dont know why IAM's Maven is looking at
"C:\Program Files\Java\jre6\..\lib\tools.jar". That path doesnt even exist
on my machine, and is not mentioned in any env var.

Also, it didnt do this the last 2 days, running on same project and same
machine and same IDE. Strange...

-Ben
Re: IAM looking for Java tools in wrong place? [message #19235 is a reply to message #19032] Thu, 21 May 2009 09:17 Go to previous messageGo to next message
Abel Mui is currently offline Abel MuiFriend
Messages: 247
Registered: July 2009
Senior Member
This is caused by Maven using the same JRE you've used to launch Eclipse
(since it runs inside eclipse, it is not using the project's
configuration).

If the problem showed recently, that probably means that you added a new
maven plug-in to your build which requires a JDK.

You can force the use of a JDK with eclipse by adding the -vm PATH_TO_JDK
command line option when launching eclipse.

--
Abel Muiño


BenH wrote:

> An error has started today whenever I try to do a Maven build:

> "Unable to locate the Javac Compiler in:C:Program
> FilesJavajre6..libtools.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"

> The relevant project's JRE is pointing at a valid JDK 1.5 install.

> Machine wide JAVA_HOME is set to C:Program FilesJavajdk1.6.0_06bin

> Both contain tools.jar. I dont know why IAM's Maven is looking at
> "C:Program FilesJavajre6..libtools.jar". That path doesnt even exist
> on my machine, and is not mentioned in any env var.

> Also, it didnt do this the last 2 days, running on same project and same
> machine and same IDE. Strange...

> -Ben
Re: IAM looking for Java tools in wrong place? [message #569194 is a reply to message #19032] Thu, 21 May 2009 09:17 Go to previous messageGo to next message
Abel Mui is currently offline Abel MuiFriend
Messages: 247
Registered: July 2009
Senior Member
This is caused by Maven using the same JRE you've used to launch Eclipse
(since it runs inside eclipse, it is not using the project's
configuration).

If the problem showed recently, that probably means that you added a new
maven plug-in to your build which requires a JDK.

You can force the use of a JDK with eclipse by adding the -vm PATH_TO_JDK
command line option when launching eclipse.

--
Abel Muiño


BenH wrote:

> An error has started today whenever I try to do a Maven build:

> "Unable to locate the Javac Compiler in:C:Program
> FilesJavajre6..libtools.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"

> The relevant project's JRE is pointing at a valid JDK 1.5 install.

> Machine wide JAVA_HOME is set to C:Program FilesJavajdk1.6.0_06bin

> Both contain tools.jar. I dont know why IAM's Maven is looking at
> "C:Program FilesJavajre6..libtools.jar". That path doesnt even exist
> on my machine, and is not mentioned in any env var.

> Also, it didnt do this the last 2 days, running on same project and same
> machine and same IDE. Strange...

> -Ben
Re: IAM looking for Java tools in wrong place? [message #648545 is a reply to message #19032] Thu, 13 January 2011 13:29 Go to previous messageGo to next message
Eric Cornely is currently offline Eric CornelyFriend
Messages: 1
Registered: July 2009
Junior Member
I installed m2eclipse which says when you're running a jre in place of a jdk so changed my eclipse.ini to this :

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.6.0_23\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


So i'm now sure that i use jdk to run eclipse. I switched my default installed JRE in eclipse preference to the jdk folder and added tools.jar but anyway when i use iam the problem occurs.

This problem doesn't occurs when using m2eclipse. Have you any hint ?

If you want to reproduce, just try using org.codehaus.mojo:jaxws-maven-plugin:1.10:wsimport with any wsdl

[Updated on: Thu, 13 January 2011 13:34]

Report message to a moderator

Re: IAM looking for Java tools in wrong place? [message #696653 is a reply to message #648545] Thu, 14 July 2011 13:54 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
-vm
C:\Program Files\Java\jdk1.6.0_23\bin

s/b

-vm
C:\Program Files\Java\jdk1.6.0_23\bin\javaw.exe
Previous Topic:How to convert from Maven to dynamic web project
Next Topic:Problem installing IAM in Eclipse Indigo
Goto Forum:
  


Current Time: Thu Apr 25 05:21:30 GMT 2024

Powered by FUDForum. Page generated in 0.04251 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top