简体   繁体   English

Resin 上的 Java 版本错误

[英]Wrong Java version on Resin

In our project, we are using Resin as the production server.在我们的项目中,我们使用 Resin 作为生产服务器。 On my local machine, I was using Jetty but I've faced some differences in the application's behavior on different servers.在我的本地机器上,我使用的是 Jetty,但我在不同服务器上的应用程序行为方面遇到了一些差异。 That's why I am trying to add configuration to Intellij IDEA which will use Resin as an application server.这就是为什么我尝试向 Intellij IDEA 添加配置,它将使用 Resin 作为应用程序服务器。
When I am trying to run it, I get the following error:当我尝试运行它时,出现以下错误:

[20-09-03 16:35:39.134] {resin-port-80-49} warning: [options] bootstrap class path not set in conjunction with -source 1.5
                       warning: [options] source value 1.5 is obsolete and will be removed in a future release
                       warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
                       /include/header.jsp:70: error: diamond operator is not supported in -source 1.5
                                 List<String> jsEncodedItems = new ArrayList<>(list.size());
                                                                             ^
                         (use -source 7 or higher to enable diamond operator)
                       1 error
                       3 warnings

I've checked the Java version in "Project structure" and in maven's pom.xml but everywhere I've found 1.8.我已经在“项目结构”和 maven 的 pom.xml 中检查了 Java 版本,但到处都是 1.8。 Meanwhile, using Jetty I don't get an error like this, and everything works as expected.同时,使用 Jetty 我不会收到这样的错误,一切都按预期工作。
Maybe you have any idea how to fix this?也许你知道如何解决这个问题?
You can find my configuration on this screenshot:您可以在此屏幕截图中找到我的配置: 运行/调试配置

This is beacause resin uses javac to auto compile your JSP files, and without "-source " argument, it will use 1.5 as source version as default.这是因为树脂使用 javac 自动编译您的 JSP 文件,并且没有“-source”参数,它将使用 1.5 作为默认源版本。

To fix this in resin, edit resin.xml, add below inside <resin> :要在树脂中修复此问题,请编辑树脂.xml,在<resin>添加以下内容:

<javac compiler="javac" args="-source 1.8"/>

change the source version whatever you like.随意更改源版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM