Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac binaries in Linux archive #50

Closed
sm0svx opened this issue Feb 17, 2015 · 16 comments
Closed

Mac binaries in Linux archive #50

sm0svx opened this issue Feb 17, 2015 · 16 comments

Comments

@sm0svx
Copy link

sm0svx commented Feb 17, 2015

It seems like the release archives for Linux contain Mac binaries.

$ file jre/Contents/Home/jre/bin/java
jre/Contents/Home/jre/bin/java: Mach-O 64-bit x86_64 executable

Something wrong with the build?

@rahmanusta
Copy link
Member

install4j makes it so. Is it not working? I dont think it is wrong build.

@sm0svx
Copy link
Author

sm0svx commented Feb 17, 2015

No, it is not possible to run Mac binaries on Linux:

$ jre/Contents/Home/jre/bin/java
bash: jre/Contents/Home/jre/bin/java: cannot execute binary file: Exec format error

If I install Java 8 I get further

$ java -version
openjdk version "1.8.0_31"
OpenJDK Runtime Environment (build 1.8.0_31-b13)
OpenJDK 64-Bit Server VM (build 25.31-b07, mixed mode)

But not very far:

java.lang.NoClassDefFoundError: javafx/application/Application
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.install4j.runtime.launcher.UnixLauncher.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 14 more

The stack trace is displayed in a dialog that appear immediately after starting the application using:

tar xvzf /path/to/AsciidocFX_Linux.tar.gz
cd AsciidocFX
./AsciidocFX

The tool looks great so it would be cool to get it running :-)

@rahmanusta
Copy link
Member

@sm0svx I will try it on my ubuntu.

It seems that you didnt install JavaFX to OpenJDK. Install it or you can easily install Oracle JDK.

@rahmanusta
Copy link
Member

I tried bundled JRE release on Debian x64. It seems working. Did you try bundled release?

@sm0svx
Copy link
Author

sm0svx commented Feb 17, 2015

Aha, I thought everything was included in the tar archive, including JavaFX. Isn't the point of the bundled archive that nothing extra need to be installed? I used this package:

https://github.com/asciidocfx/AsciidocFX/releases/download/v1.3.2/AsciidocFX_Linux.tar.gz

When you tested on Ubuntu, are you sure you are not using a JRE 8 already present on the system instead of the bundled one? I'm having a hard time believing that Ubuntu can run MAC binaries, but stranger things have happened in the past ;-)

Anyway, I'm going to test it with the Oracle JRE.

@rahmanusta
Copy link
Member

Yes i have no JRE 8 installed in my system. I tried your installed bundle release. But, i want to be sure for this issue. @lefou is https://github.com/asciidocfx/AsciidocFX/releases/download/v1.3.2/AsciidocFX_Linux.tar.gz working on your linux system?

@sm0svx
Copy link
Author

sm0svx commented Feb 17, 2015

Now it started up just fine after installing Oracle JRE. Now off to testing it!

So, typing "java -version" just give you a "command not found" error?
Sorry, just asking to be really sure :-)

Well, I guess it would be possible to run Mac binaries in some way but it would probably require some emulation or something like "wine" (that run windows applications on Linux). Some more information here:

http://unix.stackexchange.com/questions/3322/what-makes-osx-programs-not-runnable-on-linux

Anyway, as I see it, it's an error to package Mac binaries in a Linux package. It should be the Linux JRE. The jre-8u31-linux-x64.tar.gz archive from this page made it run for me:

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

@rahmanusta
Copy link
Member

We are using install4j. It bundles JRE automatically. I dont know, there may be a software bug. But, i want to be sure.

can you try remove jre folder under AsciidocFx and use global JRE 8.

@sm0svx
Copy link
Author

sm0svx commented Feb 17, 2015

It runs fine with or without the bundled jre folder if a global Oracle JRE 8 is installed.

Now using version 1.3.3 by the way.

@rahmanusta
Copy link
Member

if not working, when no JRE 8 installed ?

@rahmanusta
Copy link
Member

Yes, you have cleared the problem. I created a different JRE for Linux archieve. You can use bundle release without global JRE 8.

Thanks

@rahmanusta
Copy link
Member

Hi @sm0svx ;

If possible can you try https://github.com/asciidocfx/AsciidocFX/releases/download/v1.3.3/AsciidocFX_Linux.tar.gz without Global JRE 8 again.

THanks

@sm0svx
Copy link
Author

sm0svx commented Feb 18, 2015

Much better :-)

Now it run out-of-the-box! The jre executable now look much better as well:

$ file jre/bin/java
jre/bin/java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.9, BuildID[sha1]=bd74b7294ebbdd93e9ef3b729e5aab228a3f681b, not stripped

@rahmanusta
Copy link
Member

:) Everything is Ok now ?

@sm0svx
Copy link
Author

sm0svx commented Feb 18, 2015

Yep! Thanks for fixing the problem. I consider the issue closed.

@rahmanusta
Copy link
Member

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants