You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Simple.java//> using jvm 22//> using javacOpt --enable-preview -Xlint:preview//> using javaOpt --enable-preview//> using mainClass Simplevoidmain() {
System.out.println("Hello from Java 22");
}
scala-cli Simple.java
# Starting compilation server# [warn] JVM that is hosting bloop is older than the requested runtime. Please restart the Build Server from your IDE.# [warn] Or run the command `bloop exit`, and then use `--jvm` flag to request a sufficient JVM version.# [warn] COMMAND_LINE# [warn] [current bloop jvm] /Users/pchabelski/Library/Caches/Coursier/arc/https/github.com/adoptium/temurin17-binaries/releases/download/jdk-17%252B35/OpenJDK17-jdk_aarch64_mac_hotspot_17_35.tar.gz/jdk-17+35/Contents/Home
Despite bloop being killed and //> using jvm 22 in the code, Scala CLI still asks for the --jvm flag to be passed to run this code.
Running with --jvm 22 works fine:
# scala-cli Simple.java --jvm 22# Starting compilation server# Compiling project (Java)# Annotation processing is enabled because one or more processors were found# on the class path. A future release of javac may disable annotation processing# unless at least one processor is specified by name (-processor), or a search# path is specified (--processor-path, --processor-module-path), or annotation# processing is enabled explicitly (-proc:only, -proc:full).# Use -Xlint:-options to suppress this message.# Use -proc:none to disable annotation processing.# [warn] ./Simple.java:7:1# [warn] implicitly declared classes are a preview feature and may be removed in a future release.# [warn] void main() {# [warn] ^# Warning: Error reading API from class file: Simple : java.lang.UnsupportedClassVersionError: Preview features are not # enabled for Simple (class file version 66.65535). Try running with '--enable-preview'# Compiled project (Java)# Hello from Java 22
Expected behaviour
I'd expect the --jvm command line option and //> using jvm directive to be interchangeable here.
The text was updated successfully, but these errors were encountered:
Gedochao
added
bug
Something isn't working
java
Issues tied to compiling & running of Java code
Bloop
Issues tied with Bloop integration.
labels
Jun 17, 2024
Version(s)
v1.3.2
Describe the bug
Bloop JVM seems to only respect the
--jvm
command line flag, while completely ignoring the//> using jvm
directive.To Reproduce
Stop Bloop if it's running
Try running the following code as
Simple.java
:Despite
bloop
being killed and//> using jvm 22
in the code, Scala CLI still asks for the--jvm
flag to be passed to run this code.Running with
--jvm 22
works fine:Expected behaviour
I'd expect the
--jvm
command line option and//> using jvm
directive to be interchangeable here.The text was updated successfully, but these errors were encountered: