jbangdev/jbang

NPE when running --native some.jsh

vorburger opened this issue · 0 comments

Just wanted to let you know about an NPE I've run into:

$ echo 'System.out.println("Hello World");' >first.jsh

$ ./jbang --native --verbose first.jsh
[jbang] [ERROR] null
java.lang.NullPointerException
        at dev.jbang.cli.BaseBuildCommand.getImageName(BaseBuildCommand.java:309)
        at dev.jbang.cli.Run.generateCommandLine(Run.java:90)
        at dev.jbang.cli.Run.doCall(Run.java:55)
        at dev.jbang.cli.BaseCommand.call(BaseCommand.java:80)
        at dev.jbang.cli.BaseCommand.call(BaseCommand.java:12)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
        at picocli.CommandLine.access$1200(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
        at picocli.CommandLine.execute(CommandLine.java:2058)
        at dev.jbang.Main.main(Main.java:14)
[jbang] If you believe this a bug in jbang open issue at https://github.com/jbangdev/jbang/issues

Based on your explanation on #506 I suspect that this is entirely "expected", but perhaps could be "handled" by failing gracefully and saying something like cannot build native images from .jsh files yet?