Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

liferay

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!

like image 727
Henok Avatar asked Jan 06 '23 02:01

Henok


1 Answers

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

like image 158
bo_ Avatar answered Jan 08 '23 16:01

bo_