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

Making PDFsam compatible with OpenJDK 11 and OpenJFX 11 #310

Closed
apoleon opened this issue Oct 23, 2018 · 15 comments
Milestone

Comments

@apoleon
Copy link

@apoleon apoleon commented Oct 23, 2018

Hello,

as you probably know Debian will release Debian 10 "Buster" with OpenJDK/OpenJFX 11 as the default Java implementation because it is long-term supported. I have tried to make PDFsam compatible with both of them. I succeeded with the compilation step but PDFsam crashes at runtime. This patch adds the missing build-dependencies:

https://salsa.debian.org/java-team/pdfsam/blob/master/debian/patches/javafx.patch

I also had to upgrade fontawesomefx to version 9.1.2 because it doesn't build with OpenJDK 11 / OpenJFX 11 anymore. I have created another patch for that and I hope it can be included at some point. I haven't had the chance to test it because of the aforementioned crash.

https://salsa.debian.org/java-team/pdfsam/blob/master/debian/patches/fontawesomefx.patch

I immediately get a segmentation fault in JavaThread "GtkNativeMainLoopThread" related to native code outside the JVM. It has something to do with libglassgtk3.so (a JavaFX 11 library) and libx11.so. I have seen the almost exact same error message with MediathekView, another JavaFX application. Version 13.0.6 works with OpenJFX 11 after patching, 13.2.1 does not. This might be a bug in JavaFX, an app should never crash this way, but it could also be some packaging mistake, missing modules, some library not loaded properly. See also Debian bug: https://bugs.debian.org/910764 and this crash log file.

https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=910764;filename=hs_err_pid6422.log;msg=37

At the moment I have javafx.base, javafx.controls and javafx.graphics on the CLASSPATH. Adding all JavaFX jars to the CLASSPATH makes no difference. I have also tried the --add-modules approach by patching pdfsam.sh accordingly but this also made no difference.

Do you have any idea what is going wrong? The complete Debian repository of PDFsam can be found at: https://salsa.debian.org/java-team/pdfsam

@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Oct 23, 2018

Hi,
I'm also starting to work on a openjdk 11 version of PDFsam. Some upgrade of the maven plugins and some fix here and there and I managed to compile and run it on Mint 18.3

immagine

I added different openjfx dependencies.
I have this for pdfsam-fx, it brings in graphics and base and I don't think we need fxml.

                 <dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-controls</artifactId>
		</dependency>

And I have this for pdfsam-gui:

		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-controls</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-media</artifactId>
		</dependency>

Sure we can upgrade fontawesomefx, no problem.
I'll take a look at the logs but at first sight I'd say it's not strictly related to PDFsam.

@apoleon

This comment has been minimized.

Copy link
Author

@apoleon apoleon commented Oct 23, 2018

I changed my javafx.patch accordingly but I still need to patch pdfsam-core/pom.xml, otherwise the build will fail. What OpenJDK/OpenJFX version do you use? Are these the official ones provided by Debian or do you use binaries from the OpenJFX project? Could you push those changes to a different branch?

@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Oct 23, 2018

Yes, true, also pdfsam-core, I've:

		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-controls</artifactId>
		</dependency>

I'm using the binaries Maven downloads from central, I assume the ones from the OpenJFX project.
Sure I'll create a branch for that.

@apoleon

This comment has been minimized.

Copy link
Author

@apoleon apoleon commented Oct 24, 2018

I found a workaround for the segmentation fault. If I pass -Djdk.gtk.version=2 to the start script, it works again. Apparently there is some kind of bug in GTK 3 related native libraries. I will forward this to the OpenJFX devs. I've just uploaded 3.3.7 to Debian unstable.

@hitam4450

This comment has been minimized.

Copy link

@hitam4450 hitam4450 commented Oct 28, 2018

i do have the same problem...pdfsam does not start on UBUNTU 18.04 and OPen-jdk-11-jre !

@apoleon

This comment has been minimized.

Copy link
Author

@apoleon apoleon commented Oct 28, 2018

On Ubuntu 18.04 use OpenJDK 8 to work around it

@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Oct 28, 2018

@apoleon I created a branch here https://github.com/torakiki/pdfsam/tree/openjdk_11
The idea is to make it PDFsam version 4 which will run with openjdk 11, do you have any deadline?

@apoleon

This comment has been minimized.

Copy link
Author

@apoleon apoleon commented Oct 28, 2018

Thanks for the OpenJDK 11 branch. I try to fix the tests next week. Our
"soft freeze" for Buster is 2019-02-12. So there is plenty of time to
release a new version of PDFsam with OpenJDK 11 support but the sooner
the better of course.

@alexhass

This comment has been minimized.

Copy link

@alexhass alexhass commented Oct 31, 2018

Can you make it compatible with AdoptOpenJDK on Windows, please? You may know Oracle start charging users for using Java 11 on Desktops. So we need to get rid if Oracle Java at all.

@alexhass

This comment has been minimized.

Copy link

@alexhass alexhass commented Nov 25, 2018

@torakiki Our deadline is Oracle Java 8 - End of Support. But I'd like to be ready weeks before the deadline. Any chance that we see a working Windows Version that works without Oracle soon?

@torakiki torakiki added this to the 4.0.0.M1 milestone Nov 27, 2018
@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Dec 19, 2018

Version 4.0.0 includes a jlinked openjdk 11

@torakiki torakiki closed this Dec 19, 2018
@alexhass

This comment has been minimized.

Copy link

@alexhass alexhass commented Dec 19, 2018

Many thanks!

@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Dec 19, 2018

@torakiki

This comment has been minimized.

Copy link
Owner

@torakiki torakiki commented Dec 31, 2018

@apoleon let me know if there's any issue with version 4

@apoleon

This comment has been minimized.

Copy link
Author

@apoleon apoleon commented Dec 31, 2018

Version 4.0.0 works perfectly for me. Thank you very much for all your work and all the best in 2019!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.