'Netbeans 8.0 Unsupported major.minor version 52.0 error
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.
Solution 1:[1]
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>
The "JDK_1.7" Java platform must be configured in Tools -> Java Platforms -> Add Platform...
Solution 2:[2]
Does anyone know what I am missing?
Well the one thing you were missing is that everything needs to be built for Java 1.7. It is not sufficient to just configure the IDE to use JDK 1.7. You have to make the IDE do the rebuild ... for everything that was previously built with Java 1.8 as the target.
Clean and rebuild all relevant projects after changing the project's Java target platform.
I also recommend that you start using Maven / Gradle / whatever to specify your build configs. This allows you to specify in the build configs what the target platform should be. If you do this, you are less likely to be burned with bad builds when you upgrade your IDE and/or development machine's default Java install.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | dav.garcia |
| Solution 2 |
