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

StackOverflow https://stackoverflow.com/questions/17555894

質問

Before posting this question here: I looked up at

1)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"

2) How do I specify the jdk for a glassfish domain?

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

4) https://www.java.net//node/702274

5) "PWC6345: There is an error in invoking javac." error when using Jetty WTP plugin to deploy a JSP page on Jetty

I am able to open the glassfish admin window in eclipse, but when I am trying to run my project, I get this annoying error: "org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required"

I looked at the above listed posts, but werent useful in my case...I have my java environment set..

But They Did not solve my problem. I still get the error as in the heading, there is already a question posted on a similar one, but doesnt have an answer I require....

役に立ちましたか?

解決

That is probably the same problem encountered with the m2clipse plugin : You have to tell eclipse to use the JDK when launching Eclipse. Only setting the JDK/JRE on the Window>Preferences has no effect.

For example add this argument :

C:\eclipse\eclipse.exe -vm C:\Java\jdk1.6.0_20\bin\javaw

Or edit the eclipse.ini file to add the vm argument.

There are plenty of possibilities. Check this link to get the right answer : m2eclipse: Eclipse is running in a JRE, but a JDK is required

他のヒント

For those who can't find an answer here...

For me this problem occured when I kept re-deploying a project on Glassfish for a while and the server ran into PermGem. This message was displayed first and sometimes it doesn't even show up. Restarting the server allways helps.

Had this issue, realized that the issue was actually with my glassfish instance and not eclipse when i deployed the same war to a remote glassfish server and it deployed fine. So i went to glassfish docs and searched how to change the jdk for your domain and this worked for me.

asadmin set "server.java-config.java-home=path-to-java-home"

Solution is simple,

All you need to do below steps : Prerequisites : Make sure JAVA_HOME, JRE_HOME, Path must be set in environment variable (both locally and system variable) and verify the same in cmd

  1. In Eclipse/STS/DeveloperStudio , Go to Windows -> Preferences -> Java -> Installed JREs
  2. Remove the old JRE_1.8.012 and add new i,e : Add -> Standard VM ->JRE Home : C:\Program Files\Java\jdk1.8.0_121 (give JDK path not JRE) -> JRE Name : jdk1.8.0_121 -> Finish
  3. Then Select, the listed JDK -> apply and close
  4. Go to Server(Tomcat) -> Runtime Environment ->verify selected runtime JREs it should be jdk1.8.0_121 (In my case)
  5. Restart Eclipse, restart server

You need to run Glassfish using a JDK rather than a JRE. I'm not entirely sure what you mean by having your Java environment set, but it wouldn't apply here. Eclipse is running the Glassfish server you told it about using the Java Runtime you told to use.

If you are like me trying to run the application in a standalone container, and not in Eclipse environment. You need to change the JVM general settings on glassfish through admin console, and restart glassfish

I added this line to 'eclipse.ini' file which is present inside eclipse folder.

-vm

C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe

and I also change the JRE path in eclipse

windows -> preferences -> java -> Installed JREs

and provided path upto jdk

C:\Program Files\Java\jdk1.8.0_131

my issue resolved.

Thanks

I faced the same problem and resolved it.My eclipse was using jre not jdk.I just changed the jre. Go to Window->Preferences->Java->Installed JRE's. Remove the entry and add the path to your jdk's bin folder. After adding don't forget that your jdk is checked and then apply and close the windows.Now the program should run.

I had this same issue, this was due to the mistake that I had forgot to set JAVA_HOME to point to the correct Java installation path in my environment variables.

Try add vaiable AS_JAVA in ./glassfish/config to asenv.bat or/and asenv.conf

Set the JDK in

  • C:\glassfish4\glassfish\config\asenv.bat
to
  • set AS_JAVA=C:\Program Files\Java\jdk1.x.x_xx
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top