B4J Question Standalone Package .EXE doesn't run, but run_debug.bat does

basefilm

Member
Using B4J 8.8.0 on Windows.

I love the 'Build Standalone Package' option. But I have to run the "run_debug.bat" batch file to run the app. If I run the .EXE, the app momentarily flashes on the screen then quits. It runs perfectly from the batch file.

Why is this? How do I find out why it is quitting? How can I fix it?
 

Gandalf

Member
Licensed User
Longtime User
1. Do you have any specific reason for using old B4J version?
2. Did you try to run exe file from Command Prompt? If yes, did you see any error message after app crash?
 
Upvote 0

basefilm

Member
1. Do you have any specific reason for using old B4J version?
2. Did you try to run exe file from Command Prompt? If yes, did you see any error message after app crash?
I have updated to v9.10, but get the same behavior.

Also, FYI it is a GUI app. Whether I start it from the cmd line or from windows explorer, it doesn't start.

It runs in the IDE or from the batch file, no issues.
 
Upvote 0

basefilm

Member
Which components are you using (jPOI, etc.)?
I'm using jStringUtils, jSQL, Json, jOKHttpUtils2, jFX, jCore, JavaObject, DBUtils, and B4XPages.

I've setup the IDE and project on two different computers also, just to test it, and same result.

Is there some kind of internal debugging I could turn on? The console Log has worked so well I haven't tried anything else. But I don't get any sort of error or warning or anything when I run the .EXE, it just quits. :(
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Hm. Ususally the run_debug.bat will show what is going on. Can you write an extra file to log at which point your app crashes (just do a write a some points)? At least you get closer to the problem.

PS: Did you try to run it as an administrator? Where do you start the package from (copy it to the desktop or just C: for a test)
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
...If not trying at the same PC B4J compiling.. may be need runtimes of .net 4.5+ ...better 4.8...

and the most important... at pc compiling - do have installed OpenJava ? ( Recommended: OpenJDK 11 + OpenJFX 11: download link. )
and ofcourse configured at: Tools > Configure Paths.
read "Installation" here: https://www.b4x.com/b4j.html

... If not having errors as you are saying... it seems problem with directories + reading files from them ---> try using file.dirapp and target to the right paths... for start target at specific directories to see if pass the errors... and try to fix with file.dirapp/dirdata/assets... have in mind file.combine...

have in mind is better using slash like linux/unix... for example "c:/b4j/projects/temp"
 
Upvote 0

basefilm

Member
...If not trying at the same PC B4J compiling.. may be need runtimes of .net 4.5+ ...better 4.8...


and the most important... at pc compiling - do have installed OpenJava ? ( Recommended: OpenJDK 11 + OpenJFX 11: download link. )
and ofcourse configured at: Tools > Configure Paths.
read "Installation" here: https://www.b4x.com/b4j.html

... If not having errors as you are saying... it seems problem with directories + reading files from them ---> try using file.dirapp and target to the right paths... for start target at specific directories to see if pass the errors... and try to fix with file.dirapp/dirdata/assets... have in mind file.combine...

have in mind is better using slash like linux/unix... for example "c:/b4j/projects/temp"
I hadn't thought of checking that, but I am using .Net 4.8.

Yes, I'm using OpenJDK11 + OpenJFX. JavaC is: C:\java\jdk-11.0.1\bin\javac.exe

Yes, I get no console errors at all when I run it from the .bat file. But it just won't run from the .exe.

I'd actually had everything running in File.Dirapp for testing, which in my environment is D:\devel\MyApp\B4J\Objects\temp\build. I copied it all out of there to run somewhere else, thinking there might be a rights issue, but it didn't help.

Thank you for your help.
 
Upvote 0

basefilm

Member
Hm. Ususally the run_debug.bat will show what is going on. Can you write an extra file to log at which point your app crashes (just do a write a some points)? At least you get closer to the problem.

PS: Did you try to run it as an administrator? Where do you start the package from (copy it to the desktop or just C: for a test)
You know, that is my old standby for debugging. Just inserting "Got here!" with a line number. I thought I was just missing some directive or Packager Property, as others have suggested, but I think I'm going to have to do that since nothing has panned out. I'll try it and post the results. Thanks!
 
Upvote 0
Top