B4J Question Javapackager 32 and 64 bit

micro

Well-Known Member
Licensed User
Longtime User
Different problems:
The installation package created is executed correctly, but when I click on the icon, says that the version is not compatible with the version of installed window.
Package and program code developed on win7/8 64 bit and package installed on win7 32bit.

Roycefer suggested to me installing the 32bit version of java and so i did (installed in Programs Files(x86)).
But now when run build in a few second (too few) appears a window message "Package built successfully" but the folder is empty.
This is the log:
B4X:
Program started.
App identifier: GestBarCode.main
Success: true
StdOut: Using base JDK at: C:\Program Files\Java\jdk1.8.0_45\jre
Bundler EXE Installer skipped because of a configuration problem: Bit architecture mismatch between FX SDK and JRE runtime. 
Advice to fix: Make sure to use JRE runtime with correct bit architecture.
StdErr:
ExitCode: 0

I must also compile the program with 32-bit versions?
 

Roycefer

Well-Known Member
Licensed User
Longtime User
The line
B4X:
StdOut: Using base JDK at: C:\Program Files\Java\jdk1.8.0_45\jre
suggests that it did not use your 32-bit JDK but rather your default 64-bit JDK.
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
No, in StdOut is Program Files but i have selected java SDK in Program Files (x86), see attached image.
 

Attachments

  • schermata.jpg
    schermata.jpg
    91.6 KB · Views: 483
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
Check out this page: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html

If you look at the General Bundler Arguments section of that page, there's an option for a "-Bruntime=...." argument. If you don't use that argument, the packager just uses the default JDK as the bundled JRE. If you want to use another one (which you do), you have to do something like "-Bruntime=C:\Program Files(x86)\Java\jdk1.8.0_45\jre". The place to add that is around line 135 of the B4JPackager source code. You'll see that that is where all the arguments are put together for the packager.

It might be best to modify the B4JPackager source code to add another TextArea and another String allowing the user to choose a JRE or just using the default one if that TextArea is empty.
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
Ok, Thanks.
If uncomment this
B4X:
'args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))
the packager is build.

Excuse Erel, can you move this thread in Questions?
Thanks
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
i have this same problem.
the solution its compile with this line comented?
B4X:
'args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))
?
 
Upvote 0

red30

Well-Known Member
Licensed User
Longtime User
I have Windows 7 x64. I installed Java JDK x86: C:\Program Files (x86)\Java\jdk1.8.0_12. In the "Tools", "Configure Paths": C:\Program Files (x86)\Java\jdk1.8.0_121\bin\javac.exe and press "Run".I Download B4JPackager uncomment
B4X:
args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))
Here setting B4JPackager: 1.png. The programm doesnt work on Windows XP. I tried to comment the line
B4X:
'args.Add("-Bruntime=" & GetSystemProperty("java.home", ""))"
Still does not work on Windows XP(( Why? Any help!! Inno Setup Compiler installed.
 
Upvote 0
Top