Software⏱️ 3 min read📅 2026-06-03

How to Fix: Compile error "Class file has wrong version 52.0, should be 50.0"

IntelliJ IDEA compatibility with Java version.

Quick Answer: Update the external JAR file to match the IntelliJ IDEA's Java version (50.0) or use a tool like javap2exe to recompile the JAR file with the correct version.

The error 'Class file has wrong version 52.0, should be 50.0' occurs when you are trying to compile a project in IntelliJ IDEA that uses a class from an external JAR file compiled with a newer Java version than what IntelliJ is using.

This issue can be frustrating for developers as it prevents the compilation of their projects and may lead to incorrect results or errors.

🛑 Root Causes of the Error

  • The primary reason for this error is that the JAR file was compiled with a newer Java version than the one used by IntelliJ IDEA.
  • Another possible cause could be that there are multiple versions of Java installed on your system, and the JAR file was compiled with a different version than what is currently set as the default.

🚀 How to Resolve This Issue

Updating the Java Version in IntelliJ IDEA

  1. Step 1: Step 1: Open IntelliJ IDEA and go to Settings (or Preferences on Mac) by pressing Alt + ; or by clicking on the gear icon in the top right corner.
  2. Step 2: Step 2: In the Settings window, navigate to Build, Execution, Deployment > Java Platform
  3. Step 3: Step 3: In the 'Java Platform' section, select the Java version that corresponds to the one used by your JAR file (in this case, Java 1.8).
  4. Step 4: Step 4: Click Apply and then OK to close the Settings window.
  5. Step 5: Step 5: Restart IntelliJ IDEA to apply the changes.

Updating the Java Version on Your System

  1. Step 1: Step 1: Open a terminal on your Mac and type 'java -version' to check which version of Java is currently installed.
  2. Step 2: Step 2: Take note of the version number and ensure that it matches the one used by your JAR file (in this case, Java 1.8).
  3. Step 3: Step 3: If you want to update the Java version on your system, you can download and install a newer version from the official Oracle website.
  4. Step 4: Step 4: Follow the installation instructions to install the new Java version.
  5. Step 5: Step 5: After installing the new Java version, restart IntelliJ IDEA to apply the changes.

🎯 Final Words

By following these steps, you should be able to resolve the 'Class file has wrong version' error in IntelliJ IDEA and successfully compile your project. Remember to always ensure that your JAR files are compatible with the Java version used by your IDE to avoid similar errors in the future.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions