Other B4J v6.80 BETA with support for Java 11

Discussion in 'B4J Questions' started by Erel, Nov 20, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Java 11 is the next long time supported version after Java 8. Oracle, the owners of Java made all kinds of changes to Java license. While it will still be possible to use older versions of Java without a paid license, they are pushing developers to OpenJDK + OpenJFX. These are the open source versions of Java. Note that their license (GPL + classpath exception) permits usage in commercial closed-source projects.

    B4J v6.80 adds support for Java 11. The changes required were mostly internal. Previous versions of Java are also supported.

    How to run Java 11?

    1. Download Java 11 with the required components: http://b4xfiles-4c17.kxcdn.com/jdk-11.0.1.zip
    This package includes the following components: OpenJDK 11 and OpenJFX 11.0.1 (SDK + jmods).

    2. Unzip the package. You can put it anywhere you like. C:\Java11 is a good place.

    3. Choose Tools - Configure Paths in the IDE and choose the new Java.

    B4JPackager will not work with Java 11. The good news is that there is a better tool available. It is written in B4J and it can be customized as needed. The tool name is B4JPackager11.

    More about B4JPackager11: https://www.b4x.com/android/forum/t...the-simplest-way-to-distribute-ui-apps.99835/


    - A new version of B4J-Bridge was released (v1.42). It is required for Java 11. If you are running Java 11 on the PC then you should also run Java 11 on the remote computer.
    - UI runnable jars are not supported in Java 11+.

    Download link:

    B4J v6.80 BETA: www.b4x.com/b4j/files/beta.exe
    Last edited: Nov 28, 2018
  2. techknight

    techknight Well-Known Member Licensed User

    Will Java 8 continue to be supported? Our powdercoating oven runs a proprietary touch based Atom PC Which is stuck on a 32bit version of windows and my app is B4J of course.

    Edit: Oops nevermind, I saw the line where you said previous versions are still supported.
  3. Daestrum

    Daestrum Well-Known Member Licensed User

    Am I imagining it or can Lambdas now be used in inline code.
    micro likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    That's true if you are using Java 11. The Java target version is set to 9.
  5. stevel05

    stevel05 Expert Licensed User

    I know you don't particularly like thank you messages Erel, but in this case I just have to say that after a couple of hours investigating Java11 and jlink in particular, this packager is a wonderful addition. It fits right in with the B4x philosophy of making things easier for your users. Not that I don't want to know what is involved behind the scenes, because I do, but I can take my time to investigate as we have a tool that works 'out of the box'. So Thank You.
    Last edited: Nov 21, 2018
  6. Erel

    Erel Administrator Staff Member Licensed User

    Thank you.

    The last time that I used the C# compiler from the command line was about 10 years ago, in the Basic4ppc era. It was fun doing it again.
    hibrid0, ThRuST, Cableguy and 6 others like this.
  7. MbedAndroid

    MbedAndroid Active Member Licensed User

  8. ThRuST

    ThRuST Well-Known Member Licensed User

    I must be dreaming? C sharp support in B4J ??? I remember it almost started a flamewar when I asked about this years ago. Seems like I was way ahead of my time. Just the victory I needed. That's a shoe in the face for everyone who dared to revolt against that I estimated this long ago. Thank you Lord Erel (The emperor :) ) I am your loyal servant. B4X is indeed powerful.

    Last edited by a moderator: Nov 22, 2018
  9. Erel

    Erel Administrator Staff Member Licensed User

    (I've removed the large image)

    No. B4J is based on Java. B4JPackager11 creates a small windows executable to start the program.
  10. Erel

    Erel Administrator Staff Member Licensed User

  11. highflyer

    highflyer Member Licensed User

    Waiting for debugger to connect...
    Program started.
    B4JPackager11 Version .90
    Include Web Module? false
    Running: C:\Users\paolo\Desktop\Java11\B4JPAC~1\Objects\temp\FindDosPath.exe
    Running: C:\jdk11\bin\jar
    Package name: b4j.example
    Running: C:\jdk11\bin\javac
    module-info.java:8: error: package java.sql is not visible
    uses java.sql.Driver;
    (package java.sql is declared in module java.sql, but module b4j does not read it)
    1 error
  12. Erel

    Erel Administrator Staff Member Licensed User

    Which jars have you added with #AdditionalJar?
  13. highflyer

    highflyer Member Licensed User

    sqlite-jdbc-3.21.0 and bcprov-jdk15on-160
    Erel likes this.
  14. Erel

    Erel Administrator Staff Member Licensed User

    I see. There is a step missing. It will be added.

    As a workaround for now you can add this line to AddStart (after the list is initialized):
  15. highflyer

    highflyer Member Licensed User

    The workaround works properly..
    thank you
  16. techknight

    techknight Well-Known Member Licensed User

    Windows doesn't know that JDK11 exists on the system if you follow this tutorial, thats the problem I am running into. (I dont use b4jpackager, I run jars directly). So I was wondering if you could update the tutorial to fix this issue? or is it just better to bundle the runtime into the app?
  17. Erel

    Erel Administrator Staff Member Licensed User

    This is the correct way.
  18. udg

    udg Expert Licensed User

    @Erel: I'm not planning to adopt JDK11 for now, but from the above comments it seems that if we will deploy five JDK11-based apps on a PC we will have five copies of a JRE11 (eventually, each one "tailored" to the specific app). Will this be the future?
  19. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    @Erel - Are there plans to implement code signing in the B4J Packager?
  20. Erel

    Erel Administrator Staff Member Licensed User

    Yes and it is better than relying on the customer having the correct Java version installed. Your app comes with a bundled JRE with the modules required by your app. The installer size is about 30 mb (without the web module). Not small but although not too large.

  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