Menu

#30 Printing defunct after update to Java11

v2.1
closed-fixed
nobody
None
5
2025-06-26
2021-04-16
No

(I guess java upgrade is the culprit, have not investigated further)

I have been using Fribok since when it was the commercial JFS.

Now i upgraded my Linux installation Mageia 7 to Mageia 8.

It can launch as normal. Launching in terminal:

$ cd "/home/morgan/Tribun/Eko/FriBok"
$ JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" java -jar *.jar                                       
Starting up...
Title     : Fribok
Version   : 2.1-SNAPSHOT-$Rev: 218 $
Build     : 2018-04-10T16:13:11Z
Directory : /home/morgan/Tribun/Eko/FriBok

Operating system: Linux
Architecture    : amd64
Java version    : 11.0.10-ea

Paths:
   APP_BASE     = /home/morgan/Tribun/Eko/FriBok
   APP_DATA     = /home/morgan/Tribun/Eko/FriBok/data
   USER_CONF    = /home/morgan/.config/fribok
   USER_DATA    = /home/morgan/.local/share/fribok
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jgoodies.looks.common.RenderingUtils (file:/home/morgan/Tribun/Eko/FriBok/fribok-2.1-SNAPSHOT-jar-with-dependencies-ver218.jar) to method sun.swing.SwingUtilities2.drawStringUnderlineCharAt(javax.swing.JComponent,java.awt.Graphics,java.lang.String,int,int,int)
WARNING: Please consider reporting this to the maintainers of com.jgoodies.looks.common.RenderingUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I experienced no problem writing a new invoice.
But when i want to print an invoice, the whole preview dialogue is greyed, and in terminal from where i started the program it say it loads precompiled report, list lots of size parametres etc, and then:

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. java.util.ResourceBundle cannot be resolved to a type
                value = (java.lang.Object)(((java.util.ResourceBundle)field_report46bundle.getValue())); //$JR_EXPR_ID=9$
                                             <---------------------->
2. java.util.ResourceBundle cannot be resolved to a type
                value = (java.lang.Object)(((java.util.ResourceBundle)field_report46bundle.getOldValue())); //$JR_EXPR_ID=9$
                                             <---------------------->
3. java.util.ResourceBundle cannot be resolved to a type
                value = (java.lang.Object)(((java.util.ResourceBundle)field_report46bundle.getValue())); //$JR_EXPR_ID=9$
                                             <---------------------->
3 errors

        at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:195)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
        at se.swedsoft.bookkeeping.print.SSReport.generateReport(SSReport.java:170)
        at se.swedsoft.bookkeeping.print.SSReport.viewReport(SSReport.java:590)
        at se.swedsoft.bookkeeping.print.SSPrinter.preview(SSPrinter.java:298)
        at se.swedsoft.bookkeeping.print.SSReportFactory$36.run(SSReportFactory.java:1306)
        at se.swedsoft.bookkeeping.gui.util.dialogs.SSProgressDialog$1.construct(SSProgressDialog.java:76)
        at com.sun.java.help.impl.SwingWorker$2.run(SwingWorker.java:129)
        at java.base/java.lang.Thread.run(Thread.java:834)

Discussion

  • Morgan Leijström

    Workaround:
    Mageia 8 can have both java 8 and 11, and I could set default java version by running

    $ sudo alternatives --config java
    
     
  • Morgan Leijström

    Alternative Workaround:
    Use full path to java:

    All needed was in my start link just replace java with /usr/lib/jvm/java-1.8.0-openjdk-1.8.0*/jre/bin/java

    Now I could set system default back to java 11

     
  • Per

    Per - 2021-10-05

    I have similar error running JFS in Windows. So I thought I just add in my work-around here.

    My starting point was snapshot 2.1 and 2.2 where neither of them were able to print out "resultatrapport" or "momsrapport".

    Working backwards through the java-versions i found out that the combination of
    Java 11 and snapshot 2.2 - Are able to print "resultatrapport" but NOT "momsrapport". GUI still looks nice.

    Java 8 and snapshot 2.2 - Are able to print "momsrapport", but GUI now look quite bad (all black background).

    In order to change the Java-version i created a bat-file with following content (edit REM to control which JAVA-version JFS should use). I learned how the java-version could be controlled here (include download links for Java as well):
    https://www.happycoders.eu/java/how-to-switch-multiple-java-versions-windows/

    @echo off
    REM set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_80
    REM set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_291
    REM set JAVA_HOME=C:\Program Files\Java\jdk-10.0.2
    set JAVA_HOME=C:\Program Files\Java\jdk-11.0.11
    REM set JAVA_HOME=C:\Program Files\Java\jdk-15
    REM set JAVA_HOME=C:\Program Files\Java\jdk-16.0.2
    REM set JAVA_HOME=C:\Program Files\Java\jdk-17
    set PATH=%JAVA_HOME%\bin;%PATH%
    @echo changing java version
    java -version
    java -Xmx1024M -Xms1024M -jar JFS_bokforing.jar
    REM java -Xmx1024M -Xms1024M -jar  fribok-2.1-SNAPSHOT-jar-with-dependencies-20180329.jar
    
     
  • Deependra Shilpi

    I have similar error running JFS in Windows. So I thought I just add in my work-around here.

    My starting point was snapshot 2.1 and 2.2 where neither of them were able to print out "resultatrapport" or "momsrapport".

    Working backwards through the java-versions i found out that the combination of
    Java 11 and snapshot 2.2 - Are able to print "resultatrapport" but NOT "momsrapport". GUI still looks nice.

    Java 8 and snapshot 2.2 - Are able to print "momsrapport", but GUI now look quite bad (all black background).

    In order to change the Java-version i created a bat-file with following content (edit REM to control which JAVA-version JFS should use). I learned how the java-version could be controlled here (include download links for Java as well):
    https://www.upsprit.com/what-is-enjin-io-crypto-and-how-is-it-revolutionizing-the-gaming-industry/

     

    Last edit: Deependra Shilpi 2023-04-14
  • Morgan Leijström

    For Mageia 9:

    FriBok does not work with java default 17 nor latest 18 versions.

    __Workaround:

    § Install package java-1.8.0-openjdk

    § Launch FriBok in the folder where you have the fribok.jar file:
    /usr/lib/jvm/java-1.8
    /jre/bin/java -jar fribok*.jar

    (In Mageia 8 that line had to be prepended with "JAVAOPTIONS=-Dawt.useSystemAAFontSettings=on " for FriBok to more reliably render some windows, but that seem not to be needed now.)

    Tested with fribok-2.2-SNAPSHOT-jar-with-dependencies.jar , downloaded today, version 242

     

    Last edit: Morgan Leijström 2023-05-02
  • Alexander Nilsson

    Another workaround, if you're using Nix / NixOS is to run this command to easily run the jar without problems generating pdfs:

    nix-shell -p jdk8 --run "java -jar fribok-2.2-SNAPSHOT-jar-with-dependencies.jar"
    
     
  • Leif-Jöran Olsson

    Ett första försök till åtgärd är v2.3-SNAPSHOT rev 243 där rapportgenerering och spara till pdf är testade med jre21.

     
  • Leif-Jöran Olsson

    • status: open --> closed-fixed
     

Log in to post a comment.