B4J Question B4JPackager11 error

Discussion in 'B4J Questions' started by Gnappos, Dec 4, 2019 at 9:37 PM.

  1. Gnappos

    Gnappos Member Licensed User

    Hello everybody
    for the first time I have used the program B4JPackager11, but on line 144
    (I attach the file MANIFEST.MF renamed to .txt)

    Sub FindPackageName As ResumableSub
    Wait For (RunShell(False, "jar", Array("xf", "jar.jar", "META-INF"))) Complete (StdOut As String)
    Dim s As String = File.ReadString(TempFolder, "META-INF/MANIFEST.MF")
    Dim m As Matcher = Regex.Matcher2($"^JavaFX-Application-Class:\s+(.*)\.main$"$, Regex.MULTILINE, s)
    m.Find
    PackageName = m.Group(1)' <======= 144 LINE <====== <=========
    Log($"Package name: ${PackageName}"$)
    Return True
    End Sub


    I get the following error:

    Waiting for debugger to connect...
    Program started.
    B4JPackager11 Version 1.13
    InputJar: C:\z\xxxxxxx - 2.00 RESILIENTE\__STARGATE B4J E ASP\STARGATE\STARGATE B4J\Objects\Stargate.jar
    Running: C:\z\B4J-IN~1\Objects\temp\FindDosPath.exe
    Running: C:\Program Files\Java\jdk-11.0.1\bin\jar
    Errore nella linea: 144 (Main)
    java.lang.IllegalStateException: No match found
    at java.base/java.util.regex.Matcher.group(Matcher.java:645)
    at anywheresoftware.b4a.keywords.Regex$MatcherWrapper.Group(Regex.java:154)
    at b4j.example.main$ResumableSub_FindPackageName.resume(main.java:997)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:136)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:85)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1086)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:119)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:29)
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you building a package for a UI app? It will not work with non-ui apps (which are simpler to distribute).
     
  3. Gnappos

    Gnappos Member Licensed User

    No I'm creating a package for a non-UI application
    I compile with jdk-11.0.1
    but in but in the target I don't know how to find and install java jdk-11.0.1
    all that today I get by launching my app on the target PC with the latest version of java 8-231, is this error message:

    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread "main" java.lang.UnsupportedClassVersionError:
    b4j/example/main has been compiled by a more recent version of the Java Runtime (class file version 53.0),
    this version of the Java Runtime only recognizes class file versions up to 52.0

    I'm really confused between the various versions of java present and between jre and sdk, I don't find an
    appropriate installation of java but only of the zip files to unpack.

    Best regards
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can compile your app with Java 8 and it will then run with a double click on any computer with Java 8+ installed.
     
    Gnappos likes this.
  5. Gnappos

    Gnappos Member Licensed User

    Thanks for the reply. But this implies an additional question that can be useful to many people:
    What is the official java version for B4J?
    Best regards
     
  6. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice