B4J Question B4JPackager, question about path [solved]

Status
Not open for further replies.

Didier9

Well-Known Member
Licensed User
Longtime User
The B4JPackager instructions say:
Using this tool is quite simple. First you need to set the path to javapackager.
On Windows the path will be similar to:
C:\Program Files\Java\jdk1.8.0_51\bin\javapackager.exe
I am not sure how I am supposed to "set the path" to javapackager
Am I supposed to add C:\Program Files\Java\jdk1.8.0_51\bin\ to the PATH environment variable (Computer->Properties->Advanced System Settings->Environment Variables->System Variables->PATH)?
Looking at the Paths Configuration in B4J, I do not see any option to set path other than for javac.exe, libraries or shared modules, and those only accept one argument which is already used.

Then later on it says:
then set the path to the Jar file
I assume that means I have to point this variable declaration
Private InputJar As String = "C:\Users\...
to my java program's jar file?

Finally:
fill the other fields
Which other fields?

Thanks in advance!
 

Didier9

Well-Known Member
Licensed User
Longtime User
I feel like a complete idiot. I get this:

What am I supposed to do with this?

B4J Packager has no form, how did you get the form to show?

I am sorry, I am just very frustrated...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
Ok, that probably explains some of the problems...
What are the differences between B4Jpackager and B4JPackager11?
Why would I use one versus the other?
I am trying to get my project into an exe that I can run on a computer that does not have B4J.
Right now, I am unable to even run the program outside of the B4J environment on the same computer and I have not found how to run it from the command line or Explorer (Windows 10).
Thank you

PS: when you say "Don't download any other version of Java 11. It will not work.", does it mean to run B4JPackager, or to run the resulting program? I am trying not to use the Oracle version of java, even though using it just to create the exe would probably be OK.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4JPackager works with Java 8 and 9. This is the old packager.
B4JPackager11 works with OpenJDK 11 + OpenJFX. This is the new packager.

Use B4JPackager11, however first test your app using Java 11. It will most probably work without any changes.

does it mean to run B4JPackager, or to run the resulting program?
In all cases. Use the Java link from the installation instructions.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
Ok got it, thank you a bunch!
I did it with B4JPackager11 and the java 11 package I downloaded from the B4J install page (OpenJDK).
I had also downloaded jdk-11.0.2 and javaFX separately and my program was running with that under the B4J environment but B4JPackager11 complained about the swing module missing.

Anyhow, I am out of the woods for now, thank you again.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
One more question: to run the exe on another computer, what do I need to do in addition to copying the exe?
I assume I need to copy the jdk11? what else?
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
I copied the exe on another machine and ran it.
I get Windows error message: "Could not find the main class, program will exit"
The executable is only 92kB, which seems very small for a standalone executable.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
This is weird. When I did the same thing on my home machine (Windows 10), the exe was the same size but it ran.
Now on this windows 7 machine, I get this message (when running the debug batch file)
Note that I rebuilt it, I did not copy the exe from the Windows 10 machine.
If I try to run the exe built on Windows 7 on a Windows 10 machine, I get a different error that the OS is different.
 

Attachments

  • Untitled.png
    52.3 KB · Views: 418
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…