Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (794)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
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 1337 times)
0 Members and 1 Guest are viewing this topic.
Offline 8Observer8
« 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
« 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
« 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
« 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
Offline gouessej
« Reply #6 - Posted 2019-04-20 11:22:04 »

I already told you that Unity may drive your WebGL program a lot slower on some machines and WebGL without using Unity can be slow on some hardware for some reasons I could repeat once more.

I advise you to use a nice build tool allowing to choose which line ending character to use in your files, for example Apache Ant.

philfrei mentioned Inno Setup but Nullsoft Scriptable Install System can be used with Apache Ant:
https://sourceforge.net/p/nsis-ant/code/ci/master/tree/

Julien Gouesse | Personal blog | Website | Jogamp
Offline 8Observer8
« Reply #7 - Posted 2019-04-21 09:21:08 »

I already told you that Unity may drive your WebGL program a lot slower on some machines and WebGL without using Unity can be slow on some hardware for some reasons I could repeat once more.
But Unity allows to create native executable from Windows for Windows, Linux, MacOS, Android, iOS and so on. Unity WebGL works on Desktop. If uses do not want (or cannot) to run Unity WebGL build he (or she) can download native build for his OS, for example, for Android. I use pure WebGL (and TypeScript) too because I can solve a lot of tasks with pure WebGL. Or I can use any WebGL wrapper: Phaser/Pixi.js (for 2D) or Three.js/Babylon.js (for 3D). This frameworks works on all mobile devices. You can check what browsers support WebGL: https://caniuse.com/#feat=webgl For example, Phaser framework is special for Mobile:
Quote
Desktop and Mobile HTML5 game framework. A fast, free and fun open source framework for Canvas and WebGL powered browser games.

I will use Unity for creating native executables for different operation systems and WebGL/TypeScript for cross-platform web-applications. Everyone can run pure WebGL by one click. I write it one and I do not need to rebuild it. Plugins are not required. Pure WebGL is very alternative for Java Applets (that was killed).

I advise you to use a nice build tool allowing to choose which line ending character to use in your files, for example Apache Ant.

philfrei mentioned Inno Setup but Nullsoft Scriptable Install System can be used with Apache Ant:
https://sourceforge.net/p/nsis-ant/code/ci/master/tree/
I am a beginner. I need very simple step by step instruction. As simple as all step by step instructions about how to create executables builds from Windows for Linux and MacOS from Unity. Or not so complicated. I have only one OS - Windows. Why cannot JarSplice make builds for Linux and MacOS correctly? Why is it so complicated for beginners in Lwjgl? I can make all build from Unity by a few clicks. And it is very easy for me to create pure crass-platform WebGL application. Lwjgl is good but it does not allow me to create crass-platform builds from Windows as simple as Unity builds and pure WebGL/TypeScript.
Offline CommanderKeith
« Reply #8 - Posted 2019-04-25 11:26:46 »

I agree that Java client side distribution leaves a lot to be desired. While I haven't used them, unity and other tools appear much more fully featured. Oracle have largely abandoned client side java.

I was quite excited about JLink which makes a smaller JVM just for your game. I followed Philfrei's adventures and other guides on the web about using it to build a small distribution. One year ago I tried and failed to port my little game from old java to new modular java and make my own jlink-ed project and failed. Making old code and external JAR file dependencies modular is extremely difficult. It's ridiculous that the Netbeans IDE's doesn't automate this properly. Maybe other IDE's do a better job now? I'm not sure.

As an aside, it's interesting that Ninite actually list two places to get the JDK from and neither are directly from Oracle: AdoptOpenJDK and Amazon Corretto JDK:
https://ninite.com/


Pages: [1]
  ignore  |  Print  
 
 

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

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

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

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

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

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

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

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

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

nelsongames (4620 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

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
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!