Solved jedit print error in FreeBSD 15

Not sure how I did it but unintentionally re-posted. Original posting was yesterday.
This duplicate should be expunged.


FreeBSD 15.0-RELEASE-p1, installed new.
Installed jedit pkg install jedit which brought in openjdk11 and there was no problem printing.
Then installed Libreoffice which brought in openjdk17 and Eclipse which brought in openjdk21.
Now printing from jedit opens a dialog with: "An error occurred while trying to print: Print job failed."
Pressing OK opens another dialog box: "An error occurred while trying to print: java.awt.print.PrinterIOexception"

Tried pkg remove jedit and reinstalling with make install clean but problem remained.

On another FreeBSD 14.3 system printing to the same network printer and with the same applications and openjdk11, openjdk17 but openjdk19, jedit prints with no problem. The Cups printer setup and configuration is the same on both systems.

While openjdk21 seems to be the only difference in the two systems and later versions of openjdk are available, I'm guessing others may know something and checking here before trying other versions of openjdk.
 
I've let this languish as I rarely need to print from jedit and other than the print error jedit does what I need. I've tried a few things which seem to confirm that the problem is with openjdk21:
removed jedit, which removes openjdk11 and eclipse which removes openjdk21. Then installed openjdk22 and jedit which reinstalls openjdk11 and printing works fine. But installing openjdk21 brings the print problem back.
I need eclipse but it brings in openjdk21 and the print problem is back.
How to remove openjdk21 without also removing eclipse or to install eclipse without bringing in openjdk21?
 
I'm not sure if it is true, but java/eclipse should work with openJDK21 ot grater. If you installed openJDK22, eclipse should install and use openJDK22, because of:
Code:
JAVA_VERSION=    21+
in its Makefile. editors/jedit also has in its Makefile
Code:
JAVA_VERSION=    11+
So any openJDK version greater than 21 should suffice. But, as I seid, I'm not sure of this.
 
I'm not sure if it is true, but java/eclipse should work with openJDK21 ot grater. If you installed openJDK22, eclipse should install and use openJDK22, because of:
Code:
JAVA_VERSION=    21+
in its Makefile. editors/jedit also has in its Makefile
Code:
JAVA_VERSION=    11+
So any openJDK version greater than 21 should suffice. But, as I seid, I'm not sure of this.
I expected what you say should work, but something is not as expected.
I edited the Makefile for jedit changing JAVA_VERSION= 22+ and rebuilt # make install clean which rebuilt jedit and openjdk22. Now jedit does not open, giving the error "java: error: no suitable JavaVMs found".

I don't see where JAVA_VERSION is specified for eclipse except within Eclipse preferences. If I replace jdk21 with jdk22 in java preferences within Eclipse, Eclipse continues to open, close and works. However, # pkg remove openjdk21 also still removes Eclipse. And reinstalling Eclipse brings openjdk21 back.

Clearly I'm trying to fix something beyond my understanding. What does seem clear is that the jedit print problem is there only if openjdk21 is installed.

I've tried to edit jedit properties to use jvm22+ too, but didn't manage to do that either.

Thanks for suggesting something.
 
Do not mess the ports tree. Install both java/eclipse and editors/jedit, if I understood you have both openJDK11 and openJDK21 and jedit is not able to print. If this is true then you can create a shell file to start jedit with this content
Bash:
#! /bin/sh
export JAVA_HOME=/usr/local/openjdk11
jedit "$@"
and see if jedit print.
 
  • Like
Reactions: bga
Your suggestion fixes it. Thanks. I had tried to set JAVA_HOME as an environmental variable before posting the problem but never succeeded. Now starting jedit with your shell script from a terminal or from the icewm menu, now calling the script, and printing works. Thanks again.
 
Back
Top