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
[robin@laptop ~]$ jbang MyScript.java [jbang] Building jar for MyScript.java...MyScript::main was called
I then tried jbang --interactive:
[robin@laptop ~]$ jbang --interactive MyScript.java[jbang] You can run the main class `mypackage.MyScript` using: userMain(args)WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign| Welcome to JShell -- Version 17.0.9| For an introduction type: /help introjshell> /envjshell> /list userMain s41 : int userMain(String[] args) { return mypackage.MyScript(args);}jshell> userMain(new String[0])| attempted to call method userMain(String[]) which cannot be invoked until variable mypackage is declaredjshell>
There seems to be two problems.
No classpath is reported by the /env command. I expected the MyScript.jar file that jbang built to be placed on the classpath.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having trouble getting
jbang --interactive
to work.Here's my trival script:
MyScript.java
I successfully ran the script:
I then tried
jbang --interactive
:There seems to be two problems.
No classpath is reported by the
/env
command. I expected theMyScript.jar
file that jbang built to be placed on the classpath.the provided
userMain
method should be:not
Beta Was this translation helpful? Give feedback.
All reactions