"Unsupported major.minor version 51.0" in Netbeans - netbeans-7

I know that the title is almost identical to other questions, but, I've not been able to resolve my problem with those answers.
This is the problem:
I have 2 almost identical projects (one has been cloned from the other with mercurial) and some changes have been made.
After the last pull from the original project, the following error appears when I try to run the project. I know that means that the project is being compiled with java7 and run with java6.
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/[...]/Start : Unsupported major.minor version 51.0
The original project keeps running normally.
It runs if I change the Java Platform in the project properties to java7, but I need the project to run on java6, so that's not an option.
Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.6.0_35; Java HotSpot(TM) 64-Bit Server VM 20.10-b01
System: Linux version 3.2.0-32-generic running on amd64; UTF-8; en_US (nb)
Thanks for your help!

You can add more than 1 jdk to your environment and you can decide which one to use. try to add the jdk 6 and compile it based on that.

Related

Gradle sync fails when creating a new Kotlin project with default settings in freshly installed IntelliJ IDEA

I wanted to learn some Kotlin so I installed IntelliJ IDEA, created a new Kotlin project with the default settings and then the IDE tells me that Gradle sync has failed. Here's the error message:
Could not open init generic class cache for initialization script 'C:\Users\<my_name>\AppData\Local\Temp\wrapper_init.gradle' (C:\Users\<my_name>\.gradle\caches\6.8\scripts\344chmz69zyndatc9zp4rwux5).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60
I googled the error and got a suggestion to try a different JDK version. Tried a few different versions but that didn't help. Then I installed the IDE on my laptop to see if that works and there I don't get any errors. As far as I can tell, the project settings were exactly the same on both machines but obviously something is messed up on my desktop computer. Both have Windows 10.
I'm also not at all familiar with the Java/Kotlin ecosystem or the build tools or whatever so I honestly have no idea how I could even begin fixing some Gradle errors. I don't really even know what Gradle is or what it does. So can you help me?
First, check the version which the project uses: File > Project Structure. Or, during project creation (https://i.stack.imgur.com/SXIzQ.png / example with SDK 1.8)
It has to be the same as JDK / SDK installed on your computer.
To verify java version installed in your terminal:
java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~19.10-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Is jboss 4.2.2 GA compatible with java 11?

We have a product that is running fine with JBoss 4.2.2/java 7.
We are now moving to JDK 11. simply added java 11 in the classpath and tried starting the server.
Encountered below error
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
-Djava.endorsed.dirs=C:\PathBuilder\GE\EMEA\vp\jboss\lib\endorsed is not supported. Endorsed standards and standalone APIs in modular form
will be supported via the concept of upgradeable modules.
removed below configurations from run.bat and started the server again
-XX:MaxPermSize=128m
"-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%"
now getting below error and which is
interrupting the ear deployment Caused by:
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.omg.CORBA.Object
Is Java 4.2.2 compatible with JDK 11 or we need to update JBoss to 7.2 or latest versions?
can someone help with this or provide related links?
JBoss 4.2 is a very old and outdated version and it only tested with JDK 1.5 and 1.6 version. If you are upgrading your JDK to 11 then you should update the JBoss to 7.3 version which is the latest available GA release from Red Hat.
You can download the jdk files of older versions like jdk6 and then replace JAVA path in the jboss run file from "set JAVA=%JAVA_HOME%\bin\java" to
"set JAVA=C:\Users\jdk1.6.0_45\bin\java"
Of course it's better to upgrade to a higher JBoss version... But in case that's not possible, you can avoid the ClassNotFoundException for org.omg.CORBA.Object by placing rt.jar from Java 8 in your JBoss-libs folder.
With this configuration you can run older JBoss versions with Java 11.

How to build Installers for java7

I have Netbeans Platform Application project. I have to build installers for all supported platforms, with using nbi. It should be built on Java8 and works on Java7.
my error is, when I try to install my application to machine with only java7
java.lang.UnsupportedClassVersionError: com/apple/eawt/ApplicationListener :
Unsupported major.minor version 52.0
I figured out that nbi.engine should rebuild with javac.target=1.7 but netbeans does not contain that sources.
Can you help me, how to download nbi.engine sources?

IntelliJ IDEA seems to not fully switch to the new jdk

I am stuck with the following problem regarding Intellij IDEA.
I had installed the following java version:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
on my Win7 PC and using Intellij IDEA v14.1.3.
After some time, I have upgraded my jdk and now I have installed the following:
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)
I have consequently changed all the references to point to the new jdk in system variables and in Intellij in Project structure ...
Everything seemed to work fine (when I run a program from Intellij I see that the command java is invoked from the right path).
The problem is that for some reasons, when I open the integrated terminal in Intellij and write java -version the result is the old version (1.7.0_51).
I realized this because of some issues of the old version of java I face when I run my unit tests that should have been resolved in the new version.
Have anybody any idea how to solve this?
Thank you in advance!
I would not only update the java version, but completely delete it from the machine. Obviously, you have not removed all the references to the old java, as your problem statements describes.
Maybe the Java Uninstall tool might be helpful for this? Then make a clean new installation.

iReport 5.5.0 won't start

I want to use iReport on ubuntu 12.04. When I try to start it, it stands still and just gives me this error:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/jna4023560596826437553.tmp which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
How can I solve this problem ?
Edit: I tried: execstack -c /tmp/jna4023560596826437553.tmp but that didn't help.
This error seems more related to a JVM problem instead of jasper. Indeed, Java 7 on linux has a feature which blocks code written in C (or other languages like Ruby etc) and linked into Java (the so-called Java Native Interface - JNI) from halting the whole VM if it’s written badly or maliciously.
So, if you're using java version 1.7, getting back to 1.6 should do the trick. But if you want to keep this version, then try a clean uninstall and re-install of java:
Uninstall,
Install
Notice that if you're not running on 1.7 , it could be a compatibility problem. Try to match the right jars required for iReport to get it work on linux.
I'm using ubuntu and I did below,
Opened the ireport.conf
and uncomment jdkhome
and added java 7 paths (since my default is java 8)
jdkhome=/home/bhanuka/Apps/jdk-7u80-linux-x64/jdk1.7.0_80