【发布时间】:2014-01-06 19:30:55
【问题描述】:
我正在尝试使用 maven 创建一个 webapp,我按照以下指南操作:http://www.youtube.com/watch?v=YeC7XQho-O0
当我创建项目时,它会说这个警告:
There are no JREs installed in the workspace that are strictly compatible with this environment. testM6 Build path JRE System Library Problem
我的 .pom 文件是
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ac.web.test</groupId>
<artifactId>testM6</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>testM6</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
当我尝试切换到这个构建标签时:
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</build>
我收到此警告:
Description Resource Path Location Type
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
testM6 Build path JRE System Library Problem
我想念什么?
非常感谢大家
我解决了这个Warning - Build path specifies execution environment J2SE-1.4
但我不明白为什么它不会自动
【问题讨论】:
-
你安装了Java吗?
-
只是出于兴趣 - 您是否有理由使用旧的 2.4 servlet api 而不是 3.x?
-
不,这只是 Eclipse 所做的,我将很快用新的 api 替换,但是感谢您的通知
标签: java eclipse maven jakarta-ee tomcat