• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Eclipse Maven project: Unable to locate the Javac Compiler

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you add the -vm option to eclipse.ini? See this discussion:
https://coderanch.com/t/488574/vc/Eclipse-running-JRE-but-JDK
 
I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic