Glassfish 3.1.2.2 in IDEA 11.1.4: “PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required”

孤街浪徒 提交于 2019-12-12 14:12:28

问题


I am trying to get our Mavenized web application up and running in a freshly installed IDEA 11.1.4 Ultimate (Windows 7) under a freshly unzipped Glassfish 3.1.2.2. I have done this many times in Eclipse, but am not familiar with IDEA.

I can build and deploy it just fine, but when I try to access pages with JSP-content I get:

PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required

The Glassfish Application Servers entry adds the javax.ejb.jar, javax.servlet-api.jar and javax.servlet.jsp-api.jar as libraries.

I have set the project SDK to point to a full JDK resulting in:

(which does not seem to include a jar with javac)

The IntelliJ tutorials I've found so far, does not mention this problem. My guess would be that the "please start using this JDK" information is not passed on to Glassfish, so it just picks up the system JRE.

What configuration step have I missed? I do not want to edit configuration files - I expect the IntelliJ plugin to do this if I know how to tell it to.


回答1:


I got the same notification and just changed in admin port -> Configurations -> server-config -> JVM Settings -> Java Home as "C:\Program Files\Java\jdk1.8.0_72", and it started working.




回答2:


PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required.

I was getting same error after restarting my glassfish 4 server.When I am trying to access my deployed application it was saying to mention full JDK.

  1. login to Glassfish admin console.(http://localhost:4848).
  2. Go to Configuration---->server-config--->JVM Settings
  3. Set the java home with your correct jdk home (ex:C:\Program Files (x86)\Java\jdk1.8.0_121).
  4. Restart the server.

It will work fine.




回答3:


Next solution helped me

source: http://alvinalexander.com/blog/post/java/fixing-glassfish-jdk-path-problem-solved

  1. Find your asenv.bat file. C:\Program Files\glassfish-4.0\glassfish\config\asenv.bat
  2. Open it in text editor and find strings like "set AS_ = blahblah"
  3. Add this string there "set AS_JAVA=C:\Program Files\Java\jdk1.7.0_60" (print your own JDK path here). If string "set AS_JAVA= blahblah" already exists then just fix the path.



回答4:


Add JDK_HOME\lib\tools.jar file to the JDK configuration Classpath.

However, the problem in your case may be different as Glassfish JDK is not taken from IntelliJ IDEA settings, this question may help:

  • How do I specify the jdk for a glassfish domain?


来源:https://stackoverflow.com/questions/13608539/glassfish-3-1-2-2-in-idea-11-1-4-pwc6345-there-is-an-error-in-invoking-javac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!