jbang: Bitbucket raw url not working

We host our own Bitbucket server and when I try to execute jbang with the raw link to the file, I always get an error. I am sorry but I can not give you a working link.

user@home:~$ jbang --verbose https://bitbucket.foobar.net/projects/JBAN/repos/examples/raw/src/main/java/examples/jfxtiles.java
[jbang] Downloaded file https://bitbucket.foobar.net/projects/JBAN/repos/examples/raw/src/main/java/examples/jfxtiles.java
[jbang] System Java version detected as 11
[jbang] System Java version matches requested version 11
[jbang] Building jar...
[jbang] compile: /opt/java/sdk/graalvm/bin/javac -classpath /home/user/.m2/repository/eu/hansolo/tilesfx/11.30/tilesfx-11.30.jar:/home/user/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:/home/user/.m2/repository/junit/junit/4.10/junit-4.10.jar:/home/user/.m2/repository/org/openjfx/javafx-media/12.0.1/javafx-media-12.0.1.jar:/home/user/.m2/repository/org/openjfx/javafx-media/12.0.1/javafx-media-12.0.1-linux.jar:/home/user/.m2/repository/org/openjfx/javafx-controls/12.0.1/javafx-controls-12.0.1.jar:/home/user/.m2/repository/org/openjfx/javafx-controls/12.0.1/javafx-controls-12.0.1-linux.jar:/home/user/.m2/repository/org/openjfx/javafx-web/12.0.1/javafx-web-12.0.1.jar:/home/user/.m2/repository/org/openjfx/javafx-web/12.0.1/javafx-web-12.0.1-linux.jar:/home/user/.m2/repository/org/openjfx/javafx-base/12.0.1/javafx-base-12.0.1.jar:/home/user/.m2/repository/org/openjfx/javafx-base/12.0.1/javafx-base-12.0.1-linux.jar:/home/user/.m2/repository/org/openjfx/javafx-graphics/12.0.1/javafx-graphics-12.0.1.jar:/home/user/.m2/repository/org/openjfx/javafx-graphics/12.0.1/javafx-graphics-12.0.1-linux.jar -d /home/user/.jbang/cache/jars/"jfxtiles.java"; filename*=UTF-8''jfxtiles.java.a559f83ce53db9459dc66a853ea4d72d27050beb88a0d13ec0b70a84cd2ac5cd /home/user/.jbang/cache/urls/9d201cddd21d493a35432a75483dc1e1f3629a1eb18f3d536e7a09f30e7e8eaf/"jfxtiles.java"; filename*=UTF-8''jfxtiles.java
/home/user/.jbang/cache/urls/9d201cddd21d493a35432a75483dc1e1f3629a1eb18f3d536e7a09f30e7e8eaf/"jfxtiles.java"; filename*=UTF-8''jfxtiles.java:82: error: class jfxtiles is public, should be declared in a file named jfxtiles.java
public class jfxtiles extends Application {
       ^
Note: /home/user/.jbang/cache/urls/9d201cddd21d493a35432a75483dc1e1f3629a1eb18f3d536e7a09f30e7e8eaf/"jfxtiles.java"; filename*=UTF-8''jfxtiles.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
[jbang] Deleting folder /home/user/.jbang/cache/jars/"jfxtiles.java"; filename*=UTF-8''jfxtiles.java.a559f83ce53db9459dc66a853ea4d72d27050beb88a0d13ec0b70a84cd2ac5cd
[jbang] [ERROR] Error during compile
dev.jbang.ExitException: Error during compile
        at dev.jbang.cli.BaseBuildCommand.buildJar(BaseBuildCommand.java:210)
        at dev.jbang.cli.BaseBuildCommand.build(BaseBuildCommand.java:137)
        at dev.jbang.cli.Run.prepareArtifacts(Run.java:83)
        at dev.jbang.cli.Run.doCall(Run.java:71)
        at dev.jbang.cli.BaseCommand.call(BaseCommand.java:85)
        at dev.jbang.cli.BaseCommand.call(BaseCommand.java:12)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        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
wget https://bitbucket.foobar.net/projects/JBAN/repos/examples/raw/src/main/java/examples/jfxtiles.java
jbang jfxtiles.java

no errors

jbang https://raw.githubusercontent.com/jbangdev/jbang-examples/master/examples/jfxtiles.java

no errors

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@KMUS the latest version of jbang should fix your problem now. 🤞

Thanks for fixing. It works perfectly now.

@KMUS the latest version of jbang should fix your problem now. 🤞

Well, I created a PR with a simple implementation anyway. It’s only a dozen lines or so and it’s definitely not foolproof but it was easy enough to write and should handle most cases.