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

Can't run a groovy script in powershell (May apply to some java scripts as well) #66

Open
BillKress opened this issue Sep 11, 2024 · 1 comment

Comments

@BillKress
Copy link

jbang version 0.117.1

If you run "jbang hello.groovy" in a powershell window you will see this error:

Error: Could not find or load main class .grape.enable=false
Caused by: java.lang.ClassNotFoundException: /grape/enable=false

The groovy script runner sets an option -Dgroovy.grape.enable=false to disable grape, however powershell treats the = specially.
I don't use other -D= options, but I assume they might cause problems as well.

I'm almost certain the same thing would happen if you passed a -D parameter to Java using the //JAVA-OPTIONS or //JAVAC-OPTIONS in Powershell.

I think the fix is to put quotes around any options containing equals signs when running in powershell.

Workaround? Use CMD or bash for now, but since windows is moving away from cmd towards powershell I expect you'll see this more often.

Great application, thank you!

@quintesse
Copy link

(oh how I hate dealing with command line parsing on Windows!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants