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
Then run jbang run --verbose Main.java, and statcktrace as following:
[jbang] [0:286] jbang version 0.107.0
[jbang] [0:299] Resolving resource ref: Main.java
[jbang] [0:302] Resolved resource ref as: Main.java (cached as: /Users/linux_china/IdeaProjects/java21-in-action/Main.java)
[jbang] [0:359] Looking for JDK: 21
[jbang] [0:363] Using JDK: 21 (21, current, /Users/linux_china/.jbang/cache/jdks/21)
[jbang] [0:363] No build required. Reusing jar from /Users/linux_china/.jbang/cache/jars/Main.java.8f8f49b93db276e6a59a1b145e26592539e968c045885a1b51ea31d3959ca24d/Main.jar
[jbang] [0:365] Looking for JDK: 21
[jbang] [0:366] Using JDK: 21 (21, current, /Users/linux_china/.jbang/cache/jdks/21)
[jbang] [0:366] Looking for JDK: 21
[jbang] [0:366] Using JDK: 21 (21, current, /Users/linux_china/.jbang/cache/jdks/21)
[jbang] [0:368] [ERROR] no main class deduced, specified nor found in a manifest
dev.jbang.cli.ExitException: no main class deduced, specified nor found in a manifest
at dev.jbang.source.generators.JarCmdGenerator.generateCommandLineList(JarCmdGenerator.java:168)
at dev.jbang.source.generators.BaseCmdGenerator.generate(BaseCmdGenerator.java:56)
at dev.jbang.cli.Run.doCall(Run.java:99)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:145)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:21)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at dev.jbang.cli.JBang$3.handle(JBang.java:148)
at dev.jbang.cli.JBang$3.handle(JBang.java:143)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at dev.jbang.Main.main(Main.java:14)
[jbang] [0:368] If you believe this a bug in jbang, open an issue at https://github.com/jbangdev/jbang/issues
You can run it with jbang run --verbose -m Main Main.java, and it works well.
JEP 445 has been implemented on openjdk/jdk@98b53c0, and next version of JDK 21 will include this feature.
The text was updated successfully, but these errors were encountered:
JEP 445 support for JBang.
Create
Main.javaJava file:Then run
jbang run --verbose Main.java, and statcktrace as following:You can run it with
jbang run --verbose -m Main Main.java, and it works well.JEP 445 has been implemented on openjdk/jdk@98b53c0, and next version of JDK 21 will include this feature.
The text was updated successfully, but these errors were encountered: