CAS4 Unsupported major.minor version 52.0 - java

I'm deploying Jasig CAS 4.0.0 using Maven Overlay Installation.
I created my custom classes and when deploying it I get this error in the cas.log:
Unsupported major.minor version 52.0 (unable to load class ...)
Environment specs
OS: Debian 7
Web server: Apache tomcat 7.0.28
Java: Oracle 8,
Java & Javac version: 1.8.0_40,
Java home: /usr/lib/jvm/java-8-oracle/jre,
Maven:v 3.0.4,
Eclipse Luna,
Maven POM
maven-compiler-plugin: 3.2
maven.compiler.source: 1.8
maven.compiler.target: 1.8
Any help is appreciated.

Your runtime must not be using Java 8 (even if you believe it does). Dbl check the one used by tomcat: if you have tomcat manager installed you can use its web page to check it, if not add echo to catalin.sh to check java version used.
Typically in linux you jave more than one Java SDK installed, with java being a link to the most recent one. But tomcat can have its own path to JavaSDK set using JAVA_HOME.

Related

firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators

I have version 11.0.1 of firebase installed on my Windows 11 machine. When I run the firebase emulators, it crashes with this message:
$ firebase emulators:start
!! emulators: firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators.
i emulators: Shutting down emulators.
Error: firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators.
I try to update my Java but it says I have the latest version:
I check what version I have and it says version 8... though I need 11? I'm confused:
I try checking the version in the CLI and I get even more confused:
$ java -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
My questions are:
How can I get my firebase emulators to run again?
What version of Java do I have? 11? 8? 1.8?
How can I upgrade to the latest version of Java?
I just had the same error and just went through the all version 8 vs. version 11, etc. but now I get it.
firebase-tools is referring to the version of the JDK installed, not the version of Java runtime installed.
The latest JDK from Oracle can be downloaded from https://www.oracle.com/java/technologies/downloads/#jdk18-mac with the latest version being 18.
The Java runtime for Mac latest version is indeed 8, but again that's not what firebase tools is looking for
For future visitors
If you're using older version of the firebase-tools(<11.), you will get some logs/warning like the following when you run the Firebase local emulator:
emulators: Support for Java version <= 10 will be dropped soon in firebase-tools#11.
Please upgrade to Java version 11 or above to continue using the emulators.
But you have this in your log:
firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11
or above to continue using the emulators
It means that you have firebase-tools>=11. and you need to install the java version 11.
In my case I preferred to downgrade my firebase-tools.
Downgrade firebase-tools
Here you can find the npm page and learn about the package and the versions.
The latest version for 10, is v10.9.2.
First you need to remove the current installed version of firebase-tools:
npm uninstall -g firebase-tools
Then you can install the version you want:
npm i -g firebase-tools#10.9.2
And there other way is to upgrade your java version to >=11 and use the latest version of firebase-tools.
The best way to tell what version you have is to open a terminal shell and type:
java -version
I think you have JDK 8. That is long past the end of its support life.
You want either JDK 11 or, better yet, 17. Those are the two LTS versions to choose from.
You can download JDK 11 or 17 from OpenJDK.
The command to deterine installed JDK is:
javac -version
(while java -version if for Java Runtime version)
I had the same issue on Windows and upgrading Java through Java updater or dowloading JDK from Oracle didn't help (propably it could).
On the other hand Firebase installation doc refers to Open JDK:
https://firebase.google.com/docs/emulator-suite/install_and_configure
So I uninstalled all "commercial" Java and downloaded:
https://openjdk.org/install/
Open JDK needs only unpacking and setting JAVA_HOME and PATH system variables:
JAVA_HOME and PATH
https://docs.plm.automation.siemens.com/content/polarion/19.1/help/en_US/polarion_windows_installation/before_installation/install_openjdk_11.html
There is no installation and messing with host system files, etc.
On macOS you can download the latest version of the JDK by downloading the OpenJDK installer on AdoptOpenJDK.

How to resolve GLIBC 2.14 error from RHEL6 servers

I have recently installed openjdk8 on RHEL6 and 7 servers. Build works on RHEl7 but giving error on RHEL6:
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by ../bin/../lib/amd64/jli/libjli.so)
ldd (GNU libc) 2.12 is installed on RHEL6, Do i need to upgrade it ?
How to resolve this issue ?
It seems that Java binary that you installed was compiled against different version of GLIBC. You might be using an RPM for RHEL7 on RHEL6.
You either need to compile the Java on RHEL6 yourself or find the correct RPM. As per OpenJDK Life Cycle and Support Policy docs Java 8 is only officially supported on RHEL 6.6 or higher.

JBoss Unsupported major.minor version 52.0

I have an application that needs to be deployed in JBoss 6.0.0 and I am using Eclipse Mars. My system variable points to Java 1.6, from build path I've selected Java 1.6 and also, JBoss is using Java 1.6. My problem is that when trying to deploy the app to JBoss the following error
[org.jboss.detailed.classloader.ClassLoaderManager] Unexpected error during load of:com.xservice.java.velocity.VelocityLoader: java.lang.UnsupportedClassVersionError: com/xservice/java/velocity/VelocityLoader : Unsupported major.minor version 52.0.
I don't have any idea how to handle this considering the given settings.
The problem was fixed by changing the Java version from Project Facets(it was 1.8 instead of 1.6). Thanks go to Sanjeev Saha.
Project facets screen
Please locate the Jar which contains the class com.xservice.java.velocity.VelocityLoader.
This class is compiled with JDK 8. The class file version for Java SE 8 is 52.0 as per http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html Your JVM is Java 6. You may not be able to run a Java class compiled with JDK 8.0 by JVM 6.0. This is the reason you are getting 'Unsupported major.minor version 52.0'
My suggestion is using a Jar which contains classes compiled by JDK 6.0.

Playframework I believe is using java 7, I'm getting Unsupported major.minor version 51.0

I'm using playframework 2.2.2 on OSX.
My command line reports I am using the following java version:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
I'm using tomcat jdbc pool, and when I load my play app I get this error:
[RuntimeException: java.lang.UnsupportedClassVersionError: org/apache/tomcat/jdbc/pool/PoolConfiguration : Unsupported major.minor version 51.0]
Now correct me if I am wrong, but I believe somehow play uses its own java version, which is java 7 correct? I remember seeing this outputted somewhere when using play but I can seem to figure out where I saw this.
So what is the issue here, is it that play is compiling using java 7 but when I run it is using version 6?
Note: I don't use the play command to run my app, rather I use sbt to enter b/c I have several projects and I then just type run.
My project layout in sbt is:
common
services
web <-- play app
How can I fix this issue as I am a little lost what is going on.
Play 2.2 is compatible with Java 6 and 7. Play itself doesn't ship with Java so your build will be picking up a version of Java that's already on your system.
Here's the logic inside the play command. As you can see, play uses the version of Java in the path or the version within JAVA_HOME.
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
Since you're getting a runtime error with a Tomcat class, I think it's most likely not a Play compile problem. My guess is that you're using a version of Tomcat that requires Java 7 or higher, such as Tomcat 8. See Apache Tomcat Versions for more info.
By the way, you can configure SBT/Play to make sure it always generates Java 6 bytecode by giving the Java compiler some options:
javacOptions ++= Seq("-source", "1.6", "-target", "1.6")
See SBT's Java Sources docs.

Unsupported major.minor version 51.0 while executing JSP

I am trying to deploy my JSP and java files on the server. But when I try to access the jsp I get the error msg
javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: com/usct/db/DBConnect : Unsupported major.minor version 51.0
I read a few posts and found out that this is due to difference in Java version on the two different platforms but I am using JAVA 1.7 on my server and my client when I do
java -version
in my jdk/bin it shows that the java version is 1.7.0_10 and
Java SE Runtime Environment (build 1.7.0_10-b18)
Can someone please help me with this issue?
Thank you
... but I am using JAVA 1.7 on my server and my client when I do ...
The most likely explanation is that you are actually using Java 1.6 or earlier ... despite what you think. In other words, when you run java -version from the command-line, you are getting a different Java installation to the one that is being used to run your web container.
(If you are on a Linux system, you should be able to tell which JVM is being used by running ps -efl and greping for "java" or similar. Alternatively, use the approach suggested by #dbf.)
It is worth noting that the version of Java on the client is not relevant. The exception is occurring on the server side.
Reference: How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
- explains the general problem and solution.
java.lang.UnsupportedClassVersionError error occurs due to higher JDK during compile time and lower JDK during runtime.
Java Version Major Version
Java 4 48.0
Java 5 49.0
Java 6 50.0
Java 7 51.0
So if you compile your Java source file with javac of JDK 1.7 it will
create class files with major version 51.0 and if you run those class
files with Java 1.6 it will throw
java.lang.unsupportedclassversionerror unsupported major.minor version
51.0 error
Try Compiling with older JDK or Upgrade the JRE.
More more information visit.
I believe com/usct/db/DBConnect is not a class provided by Java. And hence the reason of your error is not the version of jdk and jre on both your coding and execution environment. It seems the jar you used for the class DBConnect on your client and environment are of different java versions.
Try to print System.getProperty("java.version") from your JSP to check what version is actually used by your server.

Categories

Resources