• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse Maven project: Unable to locate the Javac Compiler

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15452
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add the -vm option to eclipse.ini? See this discussion:
http://www.coderanch.com/t/488574/vc/Eclipse-running-JRE-but-JDK
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic