cemfi / meico

A converter framework with support for MEI, MSM, MPM, MIDI, WAV, MP3, chroma, and XSLT
GNU General Public License v3.0
67 stars 12 forks source link

meicoApp.jar doesn't work with openjdk #28

Closed lemzwerg closed 1 year ago

lemzwerg commented 1 year ago

[openjdk 11.0.19 2023-04-18]

On my openSUSE GNU/Linux box, calling

java -jar meicoApp.jar

gives

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at meico.app.Main.main(Main.java:44)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 10 more

Is this expected? I would expect that OpenJDK 11 is recent enough for running Java 1.8. What am I missing?

axelberndt commented 1 year ago

Meico itself compiles and runs with Java 1.8+. But meicoApp, unfortunately, runs only with Java versions 1.8 to 10 (see meicoApp branch). This is due to the JavaFX dependencies. Sorry.

Please reopen this issue if it does not work on your system with OpenJDK 1.8-10 either. I have never checked it on this configuration and would be happy to get some feedback.

lemzwerg commented 1 year ago

OK, thanks, will test soon. However, marking this as 'completed' was a bit too quick IMHO :slightly_smiling_face: You should rather update the REAMDE.md file with this version information.

axelberndt commented 1 year ago

Will do. Thanks. :)

lemzwerg commented 1 year ago

FYI: On my OpenSUSE box I could make it start after installing 'java-1_8_0-openjdk' and 'java-1_8_0-openjfx'. However, I don't believe that all functionality is actually working; a quick test of loading a MEI file (first movement of KV 80) and selecting 'Score Rendering' only displays an empty window without any rendered music (see image).

Too bad that the GUI has already support for MEI to MusicXML integration but the log file says that it is not implemented yet – I dare to say that such a conversion is probably the most needed feature.

image

axelberndt commented 1 year ago

Can you provide me the MEI file, so I can test it on my system? It looks like Verovio is not working.

I recently added a fully-fledged API for MusicXML to meico. The conversions from and to MEI, however, are really not trivial. I started with it but will need more time and resources, respectively. I am not a friend of half-baked quickshots. I know that the GUI integration looks promising. ;) Please be patient.

lemzwerg commented 1 year ago

I visited https://dme.mozarteum.at/movi/de and selected KV 80, first movement, which displays just fine in my browser. I then clicked on the 'MEI CODE' tab (at the right side) and copied everything into a file (attached).

KV80.zip

BTW, I was told that the Verovio developers (Laurent Pugin et al.) are working on a MEI to MusicXML plug-in for MuseScore – I think you should contact them and bundle the efforts to avoid reinventing the wheel.

lemzwerg commented 1 year ago

By the way: Der liebe Gott hat den Computer erfunden, und der Teufel XML :-)

axelberndt commented 1 year ago

I know about Verovio's conversions and consult the sources. Well, and I have already a quite complete MEI to MSM/MPM conversion in meico. I plan adapt most of the algorithms, so I am certainly not reinventing the wheel. ;) But it takes time, nonetheless.

I also tested KV 80 ... hm, seems like the Verovio integration is completely broken. None of my test MEIs is rendered either. It is certainly not an issue of your Java distribution. Will look into it over the weekend.

axelberndt commented 1 year ago

Fixed it.

The address of the online verovio-toolkit.js changed (again) or is even abandoned (?) as of May 13th 2023. So meicoApp can no longer use the most up-to-date version online. Because of such situations, meicoApp holds a local copy to ensure stability. However, that version broke backward compatibility some time ago, so the integration did not work anymore, too. The release comments never mentioned such changes (e.g. to the method names and option attributes).

I updated now to the most recent release version 3.15.0-5abc7c0 and applied all code changes to make it work again, somewhat. However, these unpleasant surprises take too much effort to fix. I will, probably, no longer follow future Verovio updates. In meicoApp it is just a viewer anyway. I never managed to get the Java wrapper to work (platform-independent) and provide an SVG export. Anyway.

Since this was purely a change to the meicoApp and not to meico itself, I did not make a new release version but updated the 0.9.0 release. Please find the new meicoApp version there.

lemzwerg commented 1 year ago

Thanks. Regarding the backward compatibility issue, what do the Verovio developers say? I suggest that you open an issue there so that they are reminded to provide at least better release notes...

sonovice commented 1 year ago

@axelberndt Though you don't follow future updates from Verovio: You can always find the latest JS version (using WASM) here: http://www.verovio.org/javascript/latest/verovio-toolkit-wasm.js

AFAIK the Java version was never meant to be truly platform-independent. It is just a Java wrapper for the (platform-specific) C++ compilation.