Netbeans 8.0不支持的major.minor版本52.0错误 [英] Netbeans 8.0 Unsupported major.minor version 52.0 error

查看:67
本文介绍了Netbeans 8.0不支持的major.minor版本52.0错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在netbeans中编译.jar项目时遇到问题.我最近升级到了Java 1.8和NetBeans 8.0.更新每个项目后,我将其编译并放到运行Java 1.7.0_55的服务器上,然后出现"Unsupported major.minor version 52.0"问题.我知道这是由于Java版本不兼容所致.我尝试过更改可在任何可以找到的地方用于构建的jdk.我尝试使用1.7.0_55和1.7.0_07进行构建,但仍然遇到此问题.有人知道我在想什么吗?每次更改构建设置时,请确保重新编译项目.暂时无法在服务器上更新Java版本.

I am having a problem with compiled .jar projects in netbeans. I recently upgraded to java 1.8 and netbeans 8.0. After updating every project I compile and put onto my server running java 1.7.0_55 I get the "Unsupported major.minor version 52.0" issue. I know this is due to incompatible java versions. I have tried changing the jdk used for building everywhere I can find it. I have tried building with 1.7.0_55 and 1.7.0_07 and still get this issue. Does anyone know what I am missing? Each time I have changed the build settings I make sure to recompile the project. It is not possible to update the version of java on the server just yet.

推荐答案

如果使用的是Maven,则可以通过在pom.xml旁边放置一个名为nb-configuration.xml的文件来设置每个模块的JDK版本,该文件应包含以下内容:

If you are using Maven, you can set the JDK version of each module by placing a file called nb-configuration.xml beside your pom.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
        <netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
    </properties>
</project-shared-configuration>

必须在工具-> Java平台->添加平台...中配置"JDK_1.7" Java平台.

The "JDK_1.7" Java platform must be configured in Tools -> Java Platforms -> Add Platform...

这篇关于Netbeans 8.0不支持的major.minor版本52.0错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆