Advertisement

Please, run my GLFW example on three OS: Linux, macOS and Windows

Started by April 06, 2019 10:21 AM
14 comments, last by LXTest 5 years, 10 months ago

I created very simple example using Java+GLFW+LWJGL3 and deprecated OpenGL 1.1. I want to use this example for testing that executable file works on your machines. I want to be sure that JarSplice works correctly. Please, run it and say that this example works on Linux and Mac. I created this builds from Windows 10. If you have Windows, please, try to run it on Windows.

TheQuad.png.b9668a1c6fc918db4ba1df89e9850bf0.png

My friend valen10 tried to run my example using Debian 10 and he received this error message:


$ ./TheQuad_Linux.sh
Failed to execute process './TheQuad_Linux.sh'. Reason:
', which is not an executable command.d the interpreter '/bin/sh

He opened .sh using hex-editor, replaced \r\n on \n and it works fine. How can I solve this problem on my side in JarSplice?

Advertisement

Works on Windows 10 for me. I can try on Mac Later...

image.png.096fe2081338bc24fc8966f9be8b2d32.png

Programmer and 3D Artist

Same output Windows 7 - Intel i7 - gforce 9300M

There was something about forward slashes and back slashes that might be worth looking into between the os flavors. The other thing I'm thinking is separate the command in a pre process condition maybe or re #define the carriage return at compile time as the appropriate sequence.

Dev careful. Pixel on board.
Buckle up. Everything will be revealed.

1 hour ago, 8Observer8 said:

which is not an executable command.d the interpreter '/bin/sh

I think I solved this problem on Linux. Please, try to run this build: TheQuad_Linux.zip If it will work I will explain you how I solved the problem.

2 hours ago, 8Observer8 said:

I think I solved this problem on Linux. Please, try to run this build: TheQuad_Linux.zip If it will work I will explain you how I solved the problem.

No, my idea does not work. I thought it will work if I would delete "lwjgl-natives-macos.jar" and "lwjgl-natives-windows.jar" from JarSplice JAR-list. Linux build works only if you will deleted 0x0D code at the beginning of the bash ".sh" file. But I do not understand where and how. I think it is impossible to deleted 0x0D on Windows.

Advertisement

I opened the ".sh" file in Notepad++:

CRLF_Before.png.ede636ad92e407dc76db0e5ac734632d.png

I selected the UNIX format and saved:

CRLF_After.png.ee2ee8f0a6e5a0d86707764e59766b7b.png

Please, try: TheQuad_Linux.zip

Quits without error on OSX 10.13, Java 1.7.0_71.
I'm not Java-savvy enough to pinpoint a particular problem, unfortunately.

Error: Invalid or corrupt jarfile /home/congard/Downloads/TheQuad_Linux/TheQuad_Linux/TheQuad_Linux.sh

I did not find a crass-platforms soliton for Lwjgl3 for creating standalone executables from Windows for Linux and macOS. I decided to use WebGL/TypeScript because it allow to study OpenGL and create cross-platform solutions very simple. I write code only once and it works everywhere. But browser has some restrictions. Another solution is Unity. Unity allows to create native builds for a lot of platforms from Windows.

I rewrote my example to TypeScript and WebGL. You can run it in your browser by one click: TheQuad_WebGL It must work on Window, Linux, macOS and mobile devices. You need only one click to run it from any OS like it was in deprecated Java Applets. I think WebGL is very good cross-platform tool.

Quad_WebGLTypeScript.png.fa3af61a6f58149562e229076d4e9d7d.png

Another cross-platform native solution is using Unity and C#:

Cube_Unity.gif.3e4fb118109222170a5b2a0affeb33d2.gif

This topic is closed to new replies.

Advertisement