Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (860)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  I need a tool for distributing LWJGL3 applications  (Read 377 times)
0 Members and 1 Guest are viewing this topic.
Offline 8Observer8

Senior Newbie


Exp: 1 month or less



« Posted 2019-04-07 10:12:36 »

Hello,

I need a tool that will create executable files (.exe for Windows, .app for macOS, and executable file for Linux, for example: ".sh"). I want to make builds from Window for three OS.

I tried JarSplice. But this tool has problems with LWJGL3.

First problem. For example, if you want to create .exe you need to add these two JARs:
  • lwjgl-glfw.jar
  • lwjgl-glfw-natives-windows.jar

But these JARs contains the same files:
  • glfw.dll.sha1
  • glfw32.dll.sha1

JarSplice shows the error message:

Quote
duplicate entry: glfw.dll.sha1

I solved this problem. I deleted duplicate files (for example, glfw.dll.sha1) from lwjgl-glfw.jar and another JARs. Windows build works correctly. Please, try on your computer with Windows: TheQuad_Windows.zip

Second problem (Linux). JarSplice creates the .sh file with CRLF but Linux requires LF. You can run the build on Linux: TheQuad_Linux.zip But you need manually to delete CR on Linux at the beginning of the .sh file. I tried to replace CRLF with LF, please, try it on your computer with Linux: TheQuad_Linux.zip

Third problem (macOS). JarSplice creates an executable file that does not work on macOS. Please, try to run: TheQuad_macOS.zip
Offline philfrei
« Reply #1 - Posted 2019-04-07 18:38:53 »

I am not working with LWJGL3, but I have gotten the following tools to work with both Windows 64-bit systems and with MacOS, for both Swing-based and OpenJDK11/OpenJFX11 projects.

In both cases I use jlink to create a self-contained, customized runtime. The jlink utility places the executable in a /bin subfolder. If compiled on Windows, a .bat is built there. But I don't recommend using it. Instead, for the last stage of packaging I use Inno Setup. (I used version 5, but I think they are now at version 6). This is the same third-party software referenced by Oracle in the documentation they have for distributing Windows programs. I use it to install the program in the "Program Files" folder, and to call an executable from either the Windows Start menu or from a desktop icon. I've also used this tool successfully for file association. Also, the tool does work with 32-bit Windows, in fact that is the default. I just don't use this mode because I am jlinking.

For MacOS, you might consider using the tool Packages. I like this a LOT, but there is one limitation that has stumped me. I'd prefer to install at a sub folder of the user's Home directory, but there does not appear to be a way to do this. (There is a tutorial that attempts to show how, but it doesn't work and the author of the program wrote back to me just a couple days ago to say that this is due to a known bug from the Apple side.)

However, there are provisions for adding pre- and post-install scripts (which I haven't tried yet) and the software does appear to be being kept up to date (despite having been originally written before 2010). As I said, it works great if you are installing directly to the top Applications folder. Also kind of neat, they provide source code for the tool, if you are into tinkering.

I opted to go with a simpler hack for my program. This hack is a way to create a Mac "Bundle" manually, without all the specs and Info.plist configurations. The file folder containing the program is viewed by the Mac as if it were a single .app file. Give me an hour or so, and I'll post a tutorial on this and link it here. The result can be zipped and shipped and the user can move/copy/paste it to where-ever from their /Downloads directory.

music and music apps: http://adonax.com
Offline 8Observer8

Senior Newbie


Exp: 1 month or less



« Reply #2 - Posted 2019-04-07 20:51:37 »

Thank you for your reply.

Quote
For MacOS, you might consider using the tool Packages.
I think I should have a computer with macOS or I should install macOS on VirtualBox but I do not want to do it because I work on laptop and I do not have so many space that masOS requires. I need analog of JarSplice that can create standalone executables from Windows for Linux and macOS. JarSplice was released in 2012. I this it is too old. I think this is reason why JarSplice creates standalone executables for Lwjgl incorrectly. Is exits so simple tool like JarSplice?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #3 - Posted 2019-04-07 21:12:09 »

Current documents on deployment that I've seen all say that you have to compile on the system that you want the program to run on. Could JarSplice running on a Windows PC really make programs that could run on a MacOS? Or did the jars for the Mac version first need to be compiled on a Mac?

I am using Oracle's VM on a laptop. I didn't think this laptop would support it, but it does! Maybe your laptop has similar specs and could also work?

Specs: Intel i3, 2.4 GHz, 8 GB RAM, 917 GB hard disk.

If I recall correctly, I gave the VM 4 GB RAM and 100 GB hard disk space.

But there are definite limitations:
1) JavaFX is not implemented, and does not work, and there does not seem to be a move to implement it at this time.
2) I haven't attempted to get sound to work. It could be possible to get this going but IDK and don't want to invest the effort to investigate right now.

Maybe with LWJGL the JavaFX bug is irrelevant. Swing GUI works perfectly well on the VM, as far as I can tell. (Haven't tested drag-and-drop yet...)

In any event, I'm able to compile jlink projects on the VM for use on MacOS, though I do rely on friends for additional testing. And I was able to download and run the "Packages" software tool I linked in the earlier email. BTW, I posted the "simple MacOS hack" tutorial. Maybe some form of that idea will work for you, but it would still require getting the emulator working.

music and music apps: http://adonax.com
Offline 8Observer8

Senior Newbie


Exp: 1 month or less



« Reply #4 - Posted 2019-04-09 09:39:14 »

Could JarSplice running on a Windows PC really make programs that could run on a MacOS?
It should be but it does not work in reality.

Offline 8Observer8

Senior Newbie


Exp: 1 month or less



« Reply #5 - Posted 2019-04-09 13:38:10 »

Current documents on deployment that I've seen all say that you have to compile on the system that you want the program to run on.
For example, this tool, called Unity, allows to create standalone executables from Windows (and from Mac OS X) for different platforms.

I created these builds from Windows 10. You can try to run this example if you want:

Click to Play
Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (2081 views)
2018-11-16 13:46:03

hadezbladez (799 views)
2018-11-16 13:41:33

hadezbladez (2050 views)
2018-11-16 13:35:35

hadezbladez (414 views)
2018-11-16 13:32:03

EgonOlsen (3444 views)
2018-06-10 19:43:48

EgonOlsen (3674 views)
2018-06-10 19:43:44

EgonOlsen (2271 views)
2018-06-10 19:43:20

DesertCoockie (2993 views)
2018-05-13 18:23:11

nelsongames (3070 views)
2018-04-24 18:15:36

nelsongames (3802 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!