我正在尝试使用Notepad ++作为我的一体化工具编辑,运行,编译等.
我安装了JRE,并且已将路径变量设置为.../bin目录.
当我在Notepad ++中运行"Hello world"时,我收到以下消息:
java.lang.UnsupportedClassVersionError: test_hello_world :
Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
.........................................
Run Code Online (Sandbox Code Playgroud)
我认为这里的问题是版本问题; 某些版本的Java可能是旧的或太新的.
.../binJRE或JDK中的变量有什么区别?我有多模块项目。我所有的测试都是在 JDK 7 下通过的。但是当我升级到 JDK 8 时,maven Surefire 运行了两次(它在 JDK 7 中也运行了两次)。第一次测试通过了,但第二次测试失败了。
我已经尝试升级最新的肯定会成功但没有运气。
有谁知道如何解决这个问题?
父.pom
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<fork>true</fork>
<source>${source.level}</source>
<target>${target.level}</target>
<testSource>${source.level}</testSource>
<testTarget>${target.level}</testTarget>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<argLine>-Xms512m -Xmx1024m
</argLine>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>
[1.3,)
</versionRange> …Run Code Online (Sandbox Code Playgroud)