Java編譯時一些列錯誤
1、
Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet. (Java Version Mismatch) |
確定jdk版本: 設定編譯的版本: 進入專案,設定專案的編譯版本: 進入(Maven)專案 |
2、
Description Resource Path Location Type Dynamic Web Module 3.0 requires Java 1.6 or newer. |
3.0的Web專案需要jdk7,在Maven加入下配置: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> |
3、
Eclipse中使用Maven建立或Update專案時jre變成1.5的解決辦法 |
修改maven的settings.xml檔案,在標籤<profiles>下增加: <profile> <id>jdk-1.7</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.7</jdk> </activation> <properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion> </properties> </profile>
|