Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)
closed by

Kali Linux

squirrel-sql-snapshot-20170214_2214

openjdk version "1.8.0_121"

OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-3-b13)

OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

Error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/sourceforge/squirrel_sql/client/Main : Unsupported major.minor version 52.0

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

closed

4 Answers

0 votes
by (13k points)
 
Best answer

The error message you encountered indicates an unsupported Java version issue. The version of the Java Development Kit (JDK) used to compile the SQuirreL SQL client is higher than the version of Java you currently have installed.

To resolve this issue, you have a couple of options:

1. Update your Java version: You can try updating your Java version to a newer version that supports the required major.minor version (52.0). You can visit the official Java website (https://www.oracle.com/java/technologies/javase-jdk8-downloads.html) to download and install the latest JDK 8 version compatible with your Kali Linux distribution.

2. Use a compatible SQuirreL SQL version: If updating your Java version is not feasible or doesn't solve the issue, you can try using an older version of the SQuirreL SQL client that is compatible with your current Java version. You can search for older versions of SQuirreL SQL client on their official website (http://www.squirrelsql.org/) or on software repositories specific to Kali Linux.

Ensure that the Java version and SQuirreL SQL client version you use are compatible to avoid the "Unsupported major.minor version" error.

0 votes
by (11.7k points)

So I tried editing "/usr/local/squirrel-sql-snapshot-20170214_2214/squirrel-sql.sh" and  then changed "IZPACK_JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre" to IZPACK_JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre. I believe it is a bug that has to be taken care of.

If you want to get more insights into SQL, checkout this SQL Course from Intellipaat.

0 votes
by (11.4k points)
The error you are encountering is caused by a version mismatch between the Java version used to compile the SQuirreL SQL client and the Java version installed on your system. The error message "Unsupported major.minor version" typically indicates that the Java version used to run the application is older than the version used to compile it.

In your case, the SQuirreL SQL client you are trying to run requires at least Java 8 (major version 52), but your system appears to have an older version of Java installed (1.8.0_121). To resolve this issue, you have a few options:

1. Update Java: Install a newer version of Java on your Kali Linux system. You can download and install OpenJDK 8 or a higher version. After installing the new Java version, make sure to set the `JAVA_HOME` environment variable to point to the new installation.

2. Use a compatible version: Try to find an older version of the SQuirreL SQL client that is compatible with your current Java version (1.8.0_121). You can search for older releases of SQuirreL SQL that are compatible with Java 8.

3. Check your environment: Ensure that you are running the correct version of Java by checking the `java` command in your terminal. It's possible that there might be multiple Java installations on your system, and the wrong version is being used. You can use the `java -version` command to verify the Java version.

Once you have resolved the version mismatch issue, you should be able to run the SQuirreL SQL client without encountering the "Unsupported major.minor version" error.
0 votes
by (7.8k points)
The error message you provided suggests that you're encountering an "Unsupported major.minor version" error. This error typically occurs when you're trying to run a Java program with a version of Java that is older than the one used to compile the program.

In your case, it seems that the version of Java you have installed (1.8.0_121) is not compatible with the version of SQuirreL SQL (squirrel-sql-snapshot-20170214_2214) you're trying to run. The "Unsupported major.minor version 52.0" error corresponds to Java 8, which suggests that SQuirreL SQL requires a newer version of Java.

To resolve this issue, you can try the following:

1. Update your Java version: Install a newer version of Java, such as Java 11 or Java 14, which are more recent than Java 8. You can download the latest Java Development Kit (JDK) from the official Oracle website or use a package manager specific to your Linux distribution to install Java.

2. Verify the Java version: After updating Java, verify that you're using the correct version by running the `java -version` command in the terminal. Ensure that the output shows the updated version you installed.

3. Retry running SQuirreL SQL: Once you have the updated Java version, try running SQuirreL SQL again with the newer Java installation. Make sure you're using the appropriate command or script to start SQuirreL SQL and ensure it uses the updated Java version.

By updating your Java version to a compatible one, you should be able to resolve the "Unsupported major.minor version" error and run SQuirreL SQL successfully.

Related questions

0 votes
4 answers
0 votes
1 answer
0 votes
1 answer

Browse Categories

...