Exception in thread "main" java.lang.IllegalArgumentException: PWC6309: Illegal compilerSourceVM: 12

Huy :

I tried to run this below code:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

But the IDE show me an error:

Exception in thread "main" java.lang.IllegalArgumentException: PWC6309: Illegal compilerSourceVM: 12
    at org.apache.jasper.JspC.setCompilerSourceVM(JspC.java:724)
    at org.netbeans.modules.web.project.ant.JspC.main(JspC.java:80)
    at org.netbeans.modules.web.project.ant.JspCSingle.main(JspCSingle.java:119)
F:\Code\Netbean project\Smartphone Shop\nbproject\build-impl.xml:936: Java returned: 1
BUILD FAILED (total time: 0 seconds)

How to fix this error? I used Netbeans 11.0 with Tomcat 9.0.

Yogev :

Open:

[YOUR PROJECT DIR]/nbproject/build-impl.xml

And remove or comment out these 2 lines:

<arg value="-compilerSourceVM ${javac.source}"/>
<arg value="-compilerTargetVM ${javac.target}"/>

That's it. Worked for me :)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=157757&siteId=1