B4J Question Error creating installation file with B4JPackager11

nima66

Member
I used B4J to build the software for one of the applications I wrote with B4A.
I want to use B4JPackager11 and it shows an error in the log.

err.jpg


I am using OpenJDK 14 + OpenJFX 14.
Since OpenJDK 14 does not have a javapackager.exe file, I used jdk1.8.0_91 which was previously installed.

What is the problem?
 
Last edited:

nima66

Member
Now I have installed JDK.8.0.431.x64 and Java.SE.Runtime.Environment.8.0.431.x64.
I compiled the software with this
Now in B4JPackager11 it displays the following error!

errr.jpg
 
Upvote 0

nima66

Member
Java 11+ is only compatible with 64 bit archs. You will need to use java 8 with the old packager (or distribute the jar directly) to target 32 bit. In most cases it doesn't worth the effort.
I want to cover Windows 32, 64 bit users.
So to generate exe for Windows 32 bit I have to do it manually and it is not possible in b4j. Right? (Unfortunately I don't know how to generate exe file manually and then create the setup file)
Because when I enter Java 8 address in configuration paths, build time gives message to select Java +11.
 
Upvote 0

nima66

Member
My recommendation:
- 64 bit - distribute the standalone package,
- For the 0.1% of users who use 32 bit - distribute the jar and ask them to install Java 8. They will be able to double click on the jar to run.
Your suggestion was great
This is great
Does the jar file run on 32 and 64 bit?
1. That is, if Java 11 is installed, the jar file will run on 64 bit and if Java 8 is installed, the jar file will run on 32 bit?
2. And that to run the exe file on 64 bit, there is no need to install Java 11?
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
Your suggestion was great
This is great
Does the jar file run on 32 and 64 bit?
1. That is, if Java 11 is installed, the jar file will run on 64 bit and if Java 8 is installed, the jar file will run on 32 bit?
2. And that to run the exe file on 64 bit, there is no need to install Java 11?

Your JAR will run (unmodified) on - Windows32, Windows64, MAC-OS, Linux (all variations) ..... You just have to install the correct JRE (Java Run-time Engine) ... that's the "beauty" of Java's cross-platform hardware-independent concept. I have found that using the Oracle Java 8 JRE provides the most simplicity, flexibility and consistency.
 
Upvote 0

nima66

Member
Your JAR will run (unmodified) on - Windows32, Windows64, MAC-OS, Linux (all variations) ..... You just have to install the correct JRE (Java Run-time Engine) ... that's the "beauty" of Java's cross-platform hardware-independent concept. I have found that using the Oracle Java 8 JRE provides the most simplicity, flexibility and consistency.
This is great
The only downside is that we can't create an installer for a jar file.
And I still don't know if when we generate an exe file with Java 11, we don't need to install JRE to run it? (Since I'm programming, I can't remove JRE and test)
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
This is great The only downside is that we can't create an installer for a jar file.

Yes, but all you have to do is instruct the user to install the JRE and distribute the JAR file. In the case of Oracle Java 8, the process is seamless under Windows.


And I still don't know if when we generate an exe file with Java 11, we don't need to install JRE to run it? (Since I'm programming, I can't remove JRE and test)

No you do not need the JRE if you use the packager to create the EXE. It is built into the package files.
 
Upvote 0

nima66

Member
Yes, but all you have to do is instruct the user to install the JRE and distribute the JAR file. In the case of Oracle Java 8, the process is seamless under Windows.




No you do not need the JRE if you use the packager to create the EXE. It is built into the package files.
Thank you for your guidance.
 
Upvote 0

nima66

Member
A jar created with Java 8 will work on all platforms if Java 8 is properly installed.

Java 11+ is a different story and requires building a standalone package (which is usually preferable as there are no other dependencies).
Thank you Erel for your guidance.
 
Upvote 0
Top