B4J Tutorial Create Windows native executables (exe files)

Status
Not open for further replies.

magoandroid

Member
Licensed User
Longtime User
Hi Margret,
you're thinking of deploying a single exe file.
L4J does not do this, because it is not an installer.
Exe file generated by L4J is a custom zip file.
By changing the extension from exe in the zip, find the contents of your jar file.
The exe file is a little bigger (31 kb) of the jar.
If you want to distribute a single EXE file, you can always just make a zip exploding, a folder that contains the EXE file created with L4J and a jre subdirectory that contains the copy of the JRE that you need.

Greetings.
MAgo
 

BPak

Active Member
Licensed User
Longtime User
We have programs that do what you wish for. But I do not know how.
One of the programs is named ProjectX. It is a Java development and one chap has built it as a standalone exe and if I remember correct is about 6MB in download size.
Maybe it would be worth searching out. ProjectX

http://www.videohelp.com/tools/ProjectX

There is a link down the page where the Java is included.

Hope that may be of some help.
 

giga

Well-Known Member
Licensed User
Longtime User

I have not tried either of these yet, but maybe JSmooth or Excelsior could work for you.

http://jsmooth.sourceforge.net/

or this one:

http://www.excelsiorjet.com/

Hope that's what your need.
 
Last edited:

Gaver Powers

Member
Licensed User
Longtime User
Not certain if this helps or not...

http://launch4j.sourceforge.net/docs.html

Includes a lot of discussion regarding bundling the JRE. (more in the link above)

B4X:
<jre>
Required element that groups JRE settings.
<path>, <minVersion>, <maxVersion>
The <path> property is used to specify the absolute or relative path (to the executable) of a bundled JRE, it does not rely on the current directory or <chdir>. Note that this path is not checked until the actual application execution. If you'd like the wrapper to search for a JRE (public or SDK private) use the <minVersion> property, you may also specify the <maxVersion> to prevent it from using higher Java versions. Launch4j will always use the highest version available (in the min/max range of course). If a Sun's JRE is not available or does not satisfy the search criteria, the search will be repeated on IBM runtimes. You can also combine these properties to change the startup process...

There's also more than 100 hits in their forum on the subject of Bundle JRE

http://sourceforge.net/p/launch4j/discussion/search/?q=bundle jre

This one seems pertinent

http://sourceforge.net/p/launch4j/discussion/332684/thread/356faa8d/?limit=100#a29c

G
 
Last edited:

JOTHA

Well-Known Member
Licensed User
Longtime User
... if your app doesn't work when you double click on the jar file ...
Thats my problem.
When I compile in "Release Mode", the Program starts and works well. I can see that in the Log-file.
It generates a result in the folder "Objects" named "DataCollectionServer.jar". When I doubleclick on this jar file, an error message apears: "A Java Exception has occured:" (see PNG-File)

The same error message apears after generating and clicking on the Windows.exe file. What is the problem solution?
 

Attachments

  • - Java Error Message -.png
    25.1 KB · Views: 961

JOTHA

Well-Known Member
Licensed User
Longtime User
Hello Erel,
thank you for your help!
Try to run it from the command line with java -jar <your jar name>
You will see the error message.

Also run java -version

My guess is that the default java is an older version of java.
I did what you said.
A DOS-Window apeared just for some milliseconds and I couldn't read the information.
Do you know how to stop the window to remove from the screen?
 

JOTHA

Well-Known Member
Licensed User
Longtime User
oops you where faster ...

Do you know how to stop the window to remove from the screen?
The solution is: Writing "cmd" into the command line and click Enter. A DOS-Window apears and you can see everything.

But there's no error message everything seems OK (see attached file)?
 

Attachments

  • - Java Error Message 2 -.png
    49.3 KB · Views: 835

johnerikson

Active Member
Licensed User
Longtime User
I have the same problem to start .jar file wrapped to .exe.
You can see the error message in attached file below.
What can cause this error?
 

Attachments

  • jarproblem.JPG
    171.6 KB · Views: 716

johnerikson

Active Member
Licensed User
Longtime User
No, but now, and it works well!

Anyway, I am very impressed by the whole B4x-concept.
Many thanks!
 

luke2012

Well-Known Member
Licensed User
Longtime User
Hi @Erel.
There are some additional settings to do in launch4j in order to start a web socket server ?
 

hookshy

Well-Known Member
Licensed User
Longtime User
I did try to make exe ... I did succeded to the point where i must open the file ...
I get the error invalid or corupt jar file

I can not run the original jar file on windows ...I have to make it application .exe?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…