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.

Can't use -release:8 with JDK8: 8 is not a valid choice for -release

See original GitHub issue

Compiler version

3.1.0

Minimized code

Bash script showing issue with scalac

~ % java -version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.302-b08, mixed mode)
~ % scalac -version
Scala compiler version 3.1.0 -- Copyright 2002-2021, LAMP/EPFL
~ % scalac -release:8 -help
8 is not a valid choice for -release
  scalac -help  gives more information

Output

8 is not a valid choice for -release

Expectation

Should accept the setting as this one should be safe to use.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
prolativcommented, Oct 25, 2021

As mentioned in the linked zio PR, there’s -Xtarget 8 which is direct replacement for older -target:jvm-1.8

0reactions
smartercommented, Oct 25, 2021

Right but we should encourage people to use -release instead since it ensures you don’t use new jdk APIs (that’s why we renamed target to Xtarget)

Read more comments on GitHub >

github_iconTop Results From Across the Web

'jvm-1.8' is not a valid choice for '-target' - java - Stack Overflow
I'm using Scala 2.10, JVM 1.8, source compatibility 1.7. ... language level and source compatibility may be set to version 8 by default....
Read more >
Toolchains + java 8 + scala 2.10 can pass wrong target ...
Expected Behavior Specifying JDK 8 in the java toolchain, ... 'jvm-1.8' is not a valid choice for '-target' bad option: '-target:jvm-1.8' ...
Read more >
Compatibility Guide for JDK 8 - Oracle
This document discusses types of potential incompatibilities relating to the JDK 8 release of the Java platform.
Read more >
7 Migrating From JDK 8 to Later JDK Releases
When your application is running successfully on the latest version of JDK, review Next Steps, which will help you avoid problems with future...
Read more >
Migrating From JDK 8 to Later JDK ... - Oracle Help Center
When your application is running successfully on the latest version of JDK, review Next Steps, which will help you avoid problems with future...
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