maven Unable to locate the Javac Compiler 解决办法

在使用eclipse 运行 maven install的时候,出现这个错误:

[ERROR] Unable to locate the Javac Compiler in:
  D:\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.



解决方法1、

window-->preferences-->java-->Installed JREs,编辑此项,导入tools.jar即可,



解决方法:

2、在eclipse.ini文件中设置

-vm
C:\Program Files\Java\jdk1.6.0_21\jre\bin\javaw.exe


注意

要在eclipse.ini文件中-startup之前设置这一行

2、

window-->preferences-->java-->Installed JREs:将路径设置成jre的路径


重启eclipse

阅读更多
换一批

Unable to find a javac compiler

12-08

我在用myeclipse webbrowser看http://localhost:8080/JavaWebTest/的时候,会出下面的提示rnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)rn org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnUnable to find a javac compiler;rncom.sun.tools.javac.Main is not on the classpath.rnPerhaps JAVA_HOME does not point to the JDKrn org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)rn org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)rn org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)rn org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.rnrn请问是什么问题?JAVA_HOME设成 D:\Program Files\Java\;D:\Program Files\Java\jdk1.5.0_09\对不对?

没有更多推荐了,返回首页