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

mvn error : release version 7 not supported #1416

Closed
nd185084 opened this issue Jun 1, 2024 · 3 comments
Closed

mvn error : release version 7 not supported #1416

nd185084 opened this issue Jun 1, 2024 · 3 comments

Comments

@nd185084
Copy link

nd185084 commented Jun 1, 2024

I get this error when i run the compile with visual studio code:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project Java-WebSocket: Fatal error compiling: error: release version 7 not supported -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
PS C:\Temp\Java-WebSocket-master\Java-WebSocket-master>

Any help is appreciated.

@PhilipRoman
Copy link
Collaborator

In general when reporting issues please provide at least the following info:

  • Java version (java -version)
  • Java-WebSocket library version that you are trying to compile

Anyway, pom.xml currently specifies version 7 to be compatible with very old JVMs, but recent version of java have started to drop support for cross compilation to old releases, in particular Java 20 removed support for 7: https://bugs.openjdk.org/browse/JDK-8173605

For a quick fix you can just replace <release>7</release> in pom.xml with <release>8</release> (or any other newer version)

@marci4 Any thoughts how this can be resolved long-term (since JDK will keep deprecating target versions) for users who want to build from source? Maybe update normal pom.xml to use newer target and use 7 only for Maven Central releases via config option.
I don't know anything about maven, but looks like maven supports this syntax: <release>${jws_release}</release> which can be configured using -Djws_release=7 (and the default can be set inside <build><properties>...)

@marci4
Copy link
Collaborator

marci4 commented Jun 19, 2024

Hey @PhilipRoman,
Sorry the mention got lost in my vacation mails.

To be honest, I have no good idea solving this java 7 problem.
I was surprised how many problems had problems using a java 1.7 api (introduced with API level 24).
Google Play Servers just dropped the support for API Level 20 (https://android-developers.googleblog.com/2023/07/google-play-services-discontinuing-updates-for-kitkat.html).
There is however some magic happening for some java 8 apis (https://developer.android.com/studio/write/java8-support#library-desugaring).

The main problem for me is that I don't develop any android app and I therefore have no real clue if us using java 8 is a problem or not.

Maybe I am just paranoid, idk :D

I am fine with adjusting the default, I am also fine with leaving it as is. I would expect most people trying to build a library to adjust it themselves if needed.

Best regards,
Marcel

@marci4
Copy link
Collaborator

marci4 commented Jul 12, 2024

Removing support for 1.7 with #1434

@marci4 marci4 closed this as completed Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants