B4J Question Running exe file, getting file not found, CreateProcess error=2

Shay

Well-Known Member
Licensed User
Longtime User
if I am putting notepad.exe in the same directory it is working, when putting 1.exe which is java app that was created using b4j it will not run with the following error
Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "1.exe" (in directory "C:\DEV\GAMES\One"): CreateProcess error=2, The system cannot find the file specified)

B4X:
shl.Initialize("shl","1.exe",Null)
dir = "C:\DEV\GAMES\One\"
shl.WorkingDirectory = dir
shl.Run(10000) 'set a timeout of 10 seconds
'StartMessageLoop 'need to call this as this is a console app.
 

DonManfred

Expert
Licensed User
Longtime User
Exit value: -559038737
the error is coming from 1.exe... Check the output of running the debug.bat

Looks like it is throwing an error....
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Did you just copy the .exe file to the new folder?
You have to copy the folders in objects/temp/build too to the same directory (If I remember correctly)
 
Last edited:
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
double clicking 1.exe is working fine
also trying to open run_debug.bat from the jshell gives the same error

of course I took the full directory - running the file from the dir. or from windows run command is working fine

is there other way to run it (maybe not via jshell? or using java command - similar to the run_debug)
 
Upvote 0
Top