我已经在我的应用程序的清单文件中将BREE从JavaSE-1.6
更改为JavaSE-1.7
:
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
现在我无法再次编译该应用程序。
当我运行mvn clean install
时,出现以下错误:
[INFO] Resolving dependencies of MavenProject: Xgroup:X:4.0.100-SNAPSHOT @ C:\Users\....\X\pom.xml
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING] Za
[WARNING] Zb
[INFO] Resolving class path of MavenProject: Xgroup:X:4.0.100-SNAPSHOT @ C:\Users\....\X\pom.xml
[ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle X cannot be resolved
[ERROR] Resolution errors:
[ERROR] Bundle X - Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.7
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle X cannot be resolved
Resolution errors:
Bundle X - Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.7
我的 toolchains.xml
包含:
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
<vendor>sun</vendor>
<id>JavaSE-1.7</id>
</provides>
<configuration>
<jdkHome>C:\Java\jdk1.7.0_45</jdkHome>
</configuration>
</toolchain>
当我运行
mvn -version
命令时,Java 版本似乎是正确的:Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: C:\Tools\apache-maven-3.0.4\bin\..
Java version: 1.7.0_17, vendor: Oracle Corporation
Java home: C:\Java\jdk1.7.0_17\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
我猜测我的JAVA_HOME是正确的,但我不确定。
echo %JAVA_HOME%
打印出 C:\Java\jdk1.7.0_17\jre
。Tycho邮件列表中的相关问题通过正确设置JAVA_HOME得到解决,但我的问题似乎不同。我正在使用版本为0.19.0的Tycho。我也尝试过更新版本,但这并没有改变任何事情。