Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/cmd/gomobile: cannot bind, "Source option 7 is no longer supported." #59803

Closed
SuzukiHonoka opened this issue Apr 24, 2023 · 8 comments
Labels
mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@SuzukiHonoka
Copy link

This error shows up when I'm tring to bind my library, seems to be caused by deprecated java version

gomobile: javac -d /tmp/gomobile-work-2528798080/javac-output -source 1.7 -target 1.7 -bootclasspath /home/starx/Android/Sdk/platforms/android-33/android.jar go/Seq.java go/Universe.java go/error.java spaceship_aar/Config.java spaceship_aar/LauncherWrapper.java spaceship_aar/Spaceship_aar.java failed: exit status 2
error: Source option 7 is no longer supported. Use 8 or later.
error: Target option 7 is no longer supported. Use 8 or later.
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 24, 2023
@gopherbot gopherbot added this to the Unreleased milestone Apr 24, 2023
@SuzukiHonoka
Copy link
Author

Java version info

➜  ~ java --version 
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment (build 20.0.1+9-29)
OpenJDK 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

@gopherbot
Copy link

Change https://go.dev/cl/488555 mentions this issue: [golang/go#59803] update minimal javac version to 1.8

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 25, 2023
@hajimehoshi
Copy link
Member

Found the same issue.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 31, 2023
@dmitshur dmitshur changed the title x/mobile: cannot bind, "Source option 7 is no longer supported." x/mobile/cmd/gomobile: cannot bind, "Source option 7 is no longer supported." May 31, 2023
@dpanic
Copy link

dpanic commented Jun 13, 2023

Java version info

➜  ~ java --version 
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment (build 20.0.1+9-29)
OpenJDK 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

I had the same issue. Having JDK 20 installed from Oracle. I downgraded to JDK 19, compile went through ...

@hajimehoshi
Copy link
Member

Did this happen with the latest gomobile?

@dpanic
Copy link

dpanic commented Jun 13, 2023 via email

@hajimehoshi
Copy link
Member

Could you file a new issue with more details? Thanks,

@tomdottom
Copy link

For anyone else who might run into this issue.

Make sure that the system installed gomobile tooling, and the gomobile dependency in your project are BOTH up at the latest version (or pinned to compatible versions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants