java - 线程中的异常 "main"java.lang.IllegalArgumentException : PWC6309: Illegal compilerSourceVM: 12

标签 java jsp tomcat netbeans

我尝试运行以下代码:

<%@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>

但是 IDE 显示错误:

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)

如何修复这个错误?我使用 Netbeans 11.0 和 Tomcat 9.0。

最佳答案

打开:

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

并删除或注释掉这两行:

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

就是这样。为我工作:)

关于java - 线程中的异常 "main"java.lang.IllegalArgumentException : PWC6309: Illegal compilerSourceVM: 12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55844147/

相关文章:

html - 带有 HTML 的 JSP 输出字符串?

jsp - 连接到 solr 实例时在 tomcat 中出现错误 :org. apache.solr.common.SolrException : Unable to create HttpClient instance.

spring-boot - 在生产中使用 K8 部署 spring boot 微服务

java - 为什么必须在 lambda 主体中用完整的代码块将 throw 语句括起来?

java - 错误:Execution failed for task ':app:transformClassesWithAndroidGradleClassShrinkerForDebug'

java - 如何将对象转换为XML文档

java - 登录/注销后防止 Spring Security 302 重定向

java - 无法从浏览器访问远程 Spring Boot 应用程序

java - android.view.InflateException : Binary XML file line #13: Error inflating class android. widget.TextView

java - 删除 POS 标注器的标签