1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Question [ABMaterial] GridBuilder and Java11

Discussion in 'B4J Questions' started by janderkan, Aug 19, 2019.

  1. janderkan

    janderkan Active Member Licensed User

    On Java 11 it is not possible to run a .jar file .
    I tried pack it with B4JPackager11 but I only get a blank window.
    This is the output from run_debug.bat
    Code:
    C:\2Work\1C\B4J\B4JPackager11\Objects\temp\build\bin>java.exe @release_java_modules.txt -m b4j/com.ab.main
    java.lang.NullPointerException
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.initCanvas(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderForClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderRectClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.CacheFilter.renderNodeToCache(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.CacheFilter.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderCached(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.RenderJob.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.initCanvas(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderForClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderRectClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderClip(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.CacheFilter.renderNodeToCache(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.CacheFilter.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderCached(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.RenderJob.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.initCanvas(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGCanvas.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderForcedContent(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.RenderJob.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Is the source code available? Does it work when running from the IDE?
     
  3. janderkan

    janderkan Active Member Licensed User

    No I dont have the source code, but in post #21 of this thread, AlwaysBusy states that you have the source code.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Lets wait for @alwaysbusy to try it with Java 11 from the IDE.
     
  5. alwaysbusy

    alwaysbusy Expert Licensed User

    Here is the source code. It does use a custom library I wrote (ABCanvas) but for the moment I don't seem to be able to locate the source code for this library. I will have to dive into my backups of 2016.
     

    Attached Files:

  6. janderkan

    janderkan Active Member Licensed User

    Received the source from alwaysbusy, it works fine when started from IDE, but the error from run_debug.bat is the same.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Does it work if you remove this line:
    #VirtualMachineArgs: -Dprism.order=sw
    ?
     
  8. janderkan

    janderkan Active Member Licensed User

    Then it will not even work in the IDE.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    This is the problem. You need to modify B4JPackager 11 and add it here:
    Line 281:
    Code:
    p.StartInfo.Arguments = "@release_java_modules.txt -Dprism.order=sw -m ${TargetModule}/${PackageName}.main";
     
    OliverA and alwaysbusy like this.
  10. OliverA

    OliverA Expert Licensed User

    In my case, in order for run_debug to work I also change line 297 to
    Code:
    java.exe @release_java_modules.txt -Dprism.order=sw -m ${TargetModule}/${PackageName}.main
    Does this need to a future option for B4JPackager where you can select if JavaFX should use the graphics card or not? Or enable additional command line arguments?
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    This will be added.
     
    OliverA likes this.
  12. janderkan

    janderkan Active Member Licensed User

    WORKS PERFECT.
    Thank You
     
    alwaysbusy likes this.
  13. Erel

    Erel Administrator Staff Member Licensed User

  14. janderkan

    janderkan Active Member Licensed User

  15. Erel

    Erel Administrator Staff Member Licensed User

    The relevant line is 283 and it was changed:

    [​IMG]
     
    Johan Hormaza likes this.
  16. janderkan

    janderkan Active Member Licensed User

    Please look at post #9
    Code:
    p.StartInfo.Arguments = "@release_java_modules.txt -Dprism.order=sw -m ${TargetModule}/${PackageName}.main";
    In release 1.13 Run does not work, Run_debug works.
    Adding both line 281 and 297 , Run and Run_debug works.
     
    Last edited: Aug 19, 2019
  17. OliverA

    OliverA Expert Licensed User

    I've tested the new version of B4JPackager (v 1.13) and it works correctly for this case. The only thing you have to add manually to run_debug.bat is the -dark command line parameter (if you want dark mode - which seems to be the preferred mode for ABMGruidBuilder). For run.exe, use it with the -dark command line argument. Alternative would be again to change B4JPackager's code to include -dark command line option (in the same places (with new line numbers) as this fix). Either that, or @Erel produces another B4JPackager11 that allows for command line arguments.
     
  18. janderkan

    janderkan Active Member Licensed User

    I used v 1.12 and I got the error i post #1
    I changed line 281 and 297 and it worked great.
    With v1.13 I am back to the same error.
     
  19. OliverA

    OliverA Expert Licensed User

    Did you change the VMArgs global variable (in B4JPackager11) to:
    Code:
    Private VMArgs As String = "-Dprism.order=sw"
     
  20. janderkan

    janderkan Active Member Licensed User

    This is new info, you cannot find it in this thread.
    This is the code from v1.13
    Code:
    Private VMArgs As String
    So if you run from IDE it does not work, no command line arguments.

    Adding your change it works fine.
     
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