jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Path error stops jbang finding parameter main class

Open systemsincode opened this issue 6 years ago • 3 comments

On Windows 10 Powershell I get an error saying it can't find the main class to load. This looks like a failure to cope with spaces in the path:

PS C:\WINDOWS\system32> jbang "C:\systemsincode\Java\jbang\jbangHelloWorld.java"
Could Not Find C:\Users\Matthew O'Surname\.jbang\31237.tmp
Error: Could not find or load main class O'Surname\.jbang\cache\jars\jbangHelloWorld.java.29e25d772ac7cc3c03799c4ab6cc6061d8d0999846df1db70f534a5a69c94866.jar
Caused by: java.lang.ClassNotFoundException: O'Surname\.jbang\cache\jars\jbangHelloWorld.java.29e25d772ac7cc3c03799c4ab6cc6061d8d0999846df1db70f534a5a69c94866.jar

Even thought it exists in the right location: image

systemsincode avatar Jul 11 '20 23:07 systemsincode

What version of jbang are tou running here ? Latest change radically how windows script was done.

maxandersen avatar Jul 12 '20 11:07 maxandersen

I got it off the latest default chocolately install last night (0.33.0)

systemsincode avatar Jul 12 '20 11:07 systemsincode

Most likely has to do with the space in the path name. Seems to me we should be quoting more than just the user-supplied arguments, but also (some? all?) of the arguments Jbang generates itself.

quintesse avatar Jul 12 '20 13:07 quintesse