aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse Maven project: Unable to locate the Javac Compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse Maven project: Unable to locate the Javac Compiler" Watch "Eclipse Maven project: Unable to locate the Javac Compiler" New topic
Author

Eclipse Maven project: Unable to locate the Javac Compiler

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using Eclipse Indigo on Win XP, Maven 3.0.3 and I have just built a Maven-GWT project using GWT 2.4 and the gwt-maven-plugin. Despite the fact that I have pointed my Eclipse JDK to what I have installed -- http://screencast.com/t/7TYkFh8rcObL, I'm still getting this error when I right click on my project and select the "Maven Install" option ...



I verified through the Windows start menu -> Run, "cmd" window that %JAVA_HOME% is set properly. What other settings do I need to adjust to eliminate the above error?

- Dave
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

as the errors already point out the solution.

can you paste the path right here, you set under JAVA_HOME variable.

or make sure you did right Setting Java home And Path


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Sure. The path is set to



You can see it here -- http://screencast.com/t/ON65FsgGp . I verified this path exists by going to the Start Menu, selecting "Run", entering "cmd" and then doing "cd %JAVA_HOME%" at the command prompt, which successfully changes the current working directory.

- Dave
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Opps!! I missed your first post picture.

you should select the jre instead of jdk under Installed JREs option and check the compiler option in same java tree.
and verify the right compiler within JDK Compliance.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14433
    
  23

Dave Alvarado wrote:The path is set to

You should put the bin directory of your JDK installation directory in the PATH; not the JDK installation directory itself. So this must be included in your PATH:

Note: I'm talking about the PATH environment variable, not the JAVA_HOME environment variable.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Mohammed,

I tried switching to the JRE you recommended. Also, my compiler is set to 1.6 (http://screencast.com/t/kKGB6b8IEkPW), but I got the same result as before, right-clicking on my project, seleting Run As -> Maven Install. But why would I move away from a Java installation that had javac? The error is complaining about not being able to find javac, so how do I tell the Maven-Eclipse plugin where to find it?

Jasper,

If you looked at the screen shot I sent, the thing I cut and pasted was actually my JAVA_HOME. I mistyped "path" in the previous post. My environment variables %PATH% is set to



What is the relationship between the %PATH% and %JAVA_HOME% env.vars and what the Maven Eclipse plugin uses to execute Maven commands? - Dave
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Its hard to say why eclipse pointing jre instead of jdk for locating tools.jar file, even after applied all settings correctly.

I suggest you to hit the same link again "Setting Java home And Path" and follow these steps again, specially point No. 6 and 7.

What is the relationship between the %PATH% and %JAVA_HOME% env.vars and what the Maven Eclipse plugin uses to execute Maven commands?


a little down scroll in the same link will show you the details regarding both variables.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Did you add the -vm option to eclipse.ini? See this discussion:
http://www.coderanch.com/t/488574/vc/Eclipse-running-JRE-but-JDK


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse Maven project: Unable to locate the Javac Compiler