B4J Question jar file won't run

ilan

Expert
Licensed User
Longtime User
hi

i have weird behavior with b4j. if i debug my project everything runs fine. (debug/release mode.)
now if i use release mode and then close the app and try to run the .jar file from the folde objects/*.jar
noting happens. no error, no app nothing happens. i do see a new task in the task manager but no app is showing.
but using the ide i see everything and it runs fine only if i try to run the jar file withou b4j. why is it like that?
i am using the latest b4j version. i also tried to download other jar file from the net and they run fine only b4j created jar files wont run. why??

thanks, ilan
 

jahswant

Well-Known Member
Licensed User
Longtime User
i am using the latest b4j version. i also tried to download other jar file from the net and they run fine only b4j created jar files wont run. why??
If you're using JAVA 11 it's normal. You cannot run .jar files directly. You must use the packager to create a runnable script.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
If you're using JAVA 11 it's normal. You cannot run .jar files directly. You must use the packager to create a runnable script.

ok this is new to me. So where can i diwnload that packager? Why b4j cannot build a runable jar when i use release mode?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

ilan

Expert
Licensed User
Longtime User

thanks for your help erel. i decided to change the javac.exe path from: C:\java\jdk-11.0.1\bin\javac.exe to C:\Program Files\Java\jdk1.8.0_221\bin\javac.exe.
now i can run my jar files without any problem and it also run on mac. i don't need to target the os or use any packager.

what do i loose if i don't use jdk 11 ? for my simple apps i have not found any difference? will some features won't work if i use jdk1.8.xxx ?

thanks, ilan

EDIT: ok found the answer here: https://www.b4x.com/android/forum/t...ions-java-11-x-or-java-8-x.113704/post-709596
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…