Error when starting Liferay 7 (liferay-portal-7.0-ce-ga1): PWC6345: There is an error in invoking javac.A full JDK (not just JRE) is required

≡放荡痞女 提交于 2019-11-30 18:23:34

问题


I am getting the following error when starting Liferay (liferay-portal-7.0-ce-ga1):

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

I have set my system environment variables correctly:

  • JAVA_HOME: C:\Program Files\Java\jdk1.7.0_80
  • JRE_HOME: C:\Program Files\Java\jre7

I have added my JAVA_HOME path to my system Path variable:

  • ....;C:\Program Files\Java\jdk1.7.0_80\bin;

When I run the windows where javac command, I get the following:

C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe

What am I missing?? I have also tried using JDK 1.8 and JDK 1.7.0_79. Same results.

Thanks for your help!


回答1:


After a lot of trial and error, and a lot of searching and several Windows Environment Setting Changes, I resolved this issue. I will point to the last 2 locations that led me to get over the finish-line because I had done some many things.

1) I made sure my JAVA_HOME pointed to my Java JDK (1.8.0_xx) and my JRE_HOME pointed to my Java JRE (1.8.0_xx)

2) I removed the C:\ProgramData\Oracle\Java\javapath; from my PATH variables (there were 2 PATH variables, removed from both)

3) Made sure my PATH variables (both) at the JDK Bin folder path: C:\Program Files\Java\jdk1.8.0_65\bin;

Then I checked my CMD 'where java' and received the correct response: C:\Program Files\Java\jdk1.8.0_65\bin\java.exe

4) In Eclipse, under the top menu: Windows > Preferences > Java > Installed JREs Here, I originally had the jre1.8.0_65, but I added the jdk1.8.0_65 and selected it.

5) Finally, what seemed to make the biggest difference: Right-Click on your server, and at the bottom, select Properties. A window will open up, and the 3rd option, there's clickable text "Runtime Environment". Click it and a popup will open, there will be a bottom drop-down under "Select runtime JRE" Here, I selected jdk1.8.0_65

That finally corrected the issue for me. Here are 2 links in reverse order.

http://www.huqiwen.com/2016/05/11/liferay-7-there-is-an-error-in-invoking-javac/

https://web.liferay.com/community/forums/-/message_boards/message/74821940?_19_threadView=tree




回答2:


In your environment both JRE_HOME and JAVA_HOME are set. In this case Tomcat will prefer the JRE_HOME over the JAVA_HOME. JRE_HOME should point to a JRE while JAVA_HOME should point to a JDK. You could just delete the JRE_HOME environment variable and Tomcat would automatically switch to JAVA_HOME so the isseue would be solved. If you want to keep the JRE_HOME in Windows you can change the setenv.bat by adding the following line as a first line.

set "JRE_HOME=%JAVA_HOME%"

This change will tell Tomcat that the JRE_HOME should be considered equal to JAVA_HOME and will not change your environmental variables.




回答3:


you need to set proper path to JDK in environment variables and most importantly you need to download latest eclipse neon and liferay 7 work well with java 8 only so use that

more clean and step by step tips available at

http://www.coursedecade.com

do watch it over that site.



来源:https://stackoverflow.com/questions/37170580/error-when-starting-liferay-7-liferay-portal-7-0-ce-ga1-pwc6345-there-is-an

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