Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17617

camel-jbang - Specify minimal Java version in Jbang script

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.15.0
    • 3.16.0
    • camel-jbang
    • None
    • Unknown

    Description

      jbang is using the defautl jvm that it finds. it can result to this kind of error:

      jbang -Dcamel.jbang.version=3.15.0 camel@apache/camel run test.yaml --max-messages=10 --logging-level=info --reload
      [jcordes@jcordes ~]$ jbang -Dcamel.jbang.version=3.15.0 camel@apache/camel run test.yaml --max-messages=10 --logging-level=info --reload
      [jbang] Building jar...
      /home/jcordes/.jbang/cache/urls/f20491f9ebc0e16d2fca028eb3d4f03aafdf8cd62b8af1a9d1730bfe382d8165/CamelJBang.java:28: error: cannot access CamelJBangMain
      import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
                                                     ^
        bad class file: /home/jcordes/.m2/repository/org/apache/camel/camel-jbang-core/3.15.0/camel-jbang-core-3.15.0.jar(org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.class)
          class file has wrong version 55.0, should be 52.0
          Please remove or make sure it appears in the correct subdirectory of the classpath.
      [jbang] [ERROR] Error during compile
      [jbang] Run with --verbose for more details
      

      the minimal java version can be specified https://www.jbang.dev/documentation/guide/latest/javaversions.html#managing-jdks

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            apupier Aurélien Pupier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: