B4J Question Problems Packaging an app

GuyBooth

Active Member
Licensed User
Longtime User
Let's start with the simplest problem:
My app runs from within B4J, using JDK 11, in Release mode with no problems.
If I then double-click the .jar file produced, it does nothing.
Trying to run it again from within B4J then produces this error during compile:
B4X:
Building folders structure.    Error
The process cannot access the file 'C:\B4J Desktop Music Machine\Objects\DesktopMusicMachine.jar' because it is being used by another process.
but I don't see it listed in the task manager. I also cannot delete it in Windows because it "is being used by another process". The only way I have found so far to run it again is to restart my Windows machine.
[Update: I have also tried a small test program. It has the same problem with JDK11, but seems to work ok in version 8.]
 
Last edited:

GuyBooth

Active Member
Licensed User
Longtime User
This is expected with Java 11. Use B4JPackager11 to build an installer.
Ok - now I understand that.
Which leads to the next problem I encountered. My code contains this line to find an exe I had placed in the Objects folder of my app:
B4X:
    Dim PathToDiscIDExe As String = File.Combine(File.DirApp, "discid.exe")
The Packager App appears to interpret this to refer to its own DirApp, and as a result the code following this line fails because it cannot find the file where it expects to.
I solved it by writing new code to locate the discid.exe - but I wonder if this is an unintended behaviour of the package builder?
 
Upvote 0
Top