question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsupported class file major version 61

See original GitHub issue

Bug Report

Problem:

brew instal cordova
cordova create 
cordova platform add android
cordova run android

What is expected to happen?

Should work

What does actually happen?

On JDK18 or 17 I get something like Unsupported class file major version 61 On JDK16 I get :

Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @754bd4c

Environment, Platform, Device

CPU Apple M1 ARM, flawless android development with current toolchain.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
breautekcommented, Jun 4, 2022

That error looks consistent with using the legacy android tools with a java version > 8

Android SDK has two versions of tooling, one available at $ANDROID_SDK_ROOT/tools/bin, which are legacy tools and will not work with Java 11, only java 8.

They have a newer package which can be installed via the SDK manager called cmdline-tools. Personally I’m using version 6 successfully, but I think any version of it works. Ensure that $ANDROID_SDK_ROOT/cmdline-tools/<version>/bin/ is in your path.

https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html#setting-environment-variables contains some other potentially required environment variables or paths.

0reactions
breautekcommented, Jun 4, 2022

You can try asking on SO, or you can also try asking on our Slack community. I’m pretty sure some community members do have an M1 mac…

I missed that original detail, I have never tried doing this on M1 macs yet. Don’t have access to one either unfortunately. Perhaps there is an incompatibility with M1 macs, and if there is a workaround, then we can document that in a new issue so that we can track it and hopefully find a solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsupported class file major version 61 error - Stack Overflow
I am trying to run a flutter app, and this error appeared while trying to, what I did was that I wanted to...
Read more >
Java - Unsupported class file major version 61 - Mkyong.com
It means Java 17 (major version 61) compiled the class file, and if we try to run the class file under Java 16...
Read more >
How to solve the Unsupported class file major version 61 error
The Error usually indicates a mismatch between JDK version and Java class files. This might happen when upgrading to an Artifactory version ......
Read more >
[Fixed] Unsupported class file major version 61 in Java
You will get this error when you have compiled the class with Java 17(major version 17) and you are trying to run class...
Read more >
Unsupported class file major version 61 · Issue #1082 - GitHub
General error during semantic analysis: Unsupported class file major version 61. java.lang.IllegalArgumentException: Unsupported class file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found