# UnsupportedClassVersionError when running an application

**URL:** <https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394>\
**Category:** Technical Support\
**Tags:** sdk, java\
**Created:** [April 10, 2024, 9:27am UTC](https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394 "2024-04-10T09:27:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.connor](https://forum.microej.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@s.connor](https://forum.microej.com/u/s.connor)\
**Post date:** [April 10, 2024, 9:27am UTC](https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394/1 "2024-04-10T09:27:20Z")

</div>

Hello MicroEJ ,

I have a problem running a `build-microej-javalib` module on a simulator. It’s a one year old benchmark that generates performance tests with JUnit.  
I have an **UnsupportedClassVersionError** visible below :

```auto
Cannot find main class com/microej/ui/test/_AllTests_MyTests
Exception in thread "Exception in thread <noname> (id=255): java.lang.ExceptionInInitializerError: java.lang.NullPointerException
	at java.lang.Throwable.fillInStackTrace(Throwable.java:82)
	at java.lang.Throwable.<init>(Throwable.java:32)
	at java.lang.Exception.<init>(Exception.java:14)
	at java.lang.RuntimeException.<init>(RuntimeException.java:14)
	at java.lang.NullPointerException.<init>(NullPointerException.java:6)
	at java.lang.System.buildOutputStream(System.java:239)
	at java.lang.System.<clinit>(System.java:51)
	at java.lang.Throwable.fillInStackTrace(Throwable.java:82)
	at java.lang.Throwable.<init>(Throwable.java:37)
	at java.lang.Error.<init>(Error.java:18)
	at java.lang.LinkageError.<init>(LinkageError.java:18)
	at java.lang.ClassFormatError.<init>(ClassFormatError.java:10)
	at java.lang.UnsupportedClassVersionError.<init>(UnsupportedClassVersionError.java:10)

```

For the moment, this project is on SDK 5 (23.07) using jdk-11.0.16.1+1.  
I’ve tried the following actions:

- update buildtype to `module="build-microej-javalib" revision="6.2.+"`
- update JUnit dependency to `org="ej.library.test" name="junit" rev="1.7.1"`

Do you know what could be the issue?

Thanks,  
S.

---

<div class="post-metadata">

**Author:** ![erwan.moreac](https://forum.microej.com/user_avatar/forum.microej.com/erwan.moreac/32/492_2.png) [@erwan.moreac](https://forum.microej.com/u/erwan.moreac)\
**Post date:** [April 10, 2024, 9:34am UTC](https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394/2 "2024-04-10T09:34:32Z")

</div>

Hi Sarah,

The error `UnsupportedClassVersionError` may indicate that you use the wrong version of the Java compiler for your application.

Please check if your Java Compiler uses the version **1.7** by clicking on `Window > Preferences > Java > Compiler > JDK Compliance > Compiler Compliance level`.

Below is the configuration window to configure this parameter:

 ![image](https://forum.microej.com/uploads/default/original/1X/b4e7c1cea151b39bcff3ecddc6822b7a125b6f82.png)

Sometimes when the JDK is updated to version **11** , the Compiler compliance level is updated too which generates the error you experience.

Please let us know if this message solves your issue.

Best regards,  
Erwan

---

<div class="post-metadata">

**Author:** ![s.connor](https://forum.microej.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@s.connor](https://forum.microej.com/u/s.connor)\
**Post date:** [April 10, 2024, 9:36am UTC](https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394/3 "2024-04-10T09:36:20Z")

</div>

Hi Erwan,

You were right, the `Compiler Compliance level` was set to 11 instead of 1.7.  
I retried the execution with this update and it works now.

Thanks for your help,  
S.

---

<div class="post-metadata">

**Author:** ![erwan.moreac](https://forum.microej.com/user_avatar/forum.microej.com/erwan.moreac/32/492_2.png) [@erwan.moreac](https://forum.microej.com/u/erwan.moreac)\
**Post date:** [April 10, 2024, 9:52am UTC](https://forum.microej.com/t/unsupportedclassversionerror-when-running-an-application/1394/4 "2024-04-10T09:52:13Z")

</div>

Hi Sarah,

Thanks for your feedback.

For more information about which version of Java is supported by MicroEJ, please read this documentation section [MicroEJ Runtime — MicroEJ Documentation](https://docs.microej.com/en/latest/ApplicationDeveloperGuide/runtime.html#language)

Note that you can upload in your project the `.settings/` folder which contains the file `org.eclipse.jdt.core.prefs`, in order to avoid this issue for next developers of your project.

Best regards,  
Erwan
