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

Building from sources failed on Mac #673

Open
ShogunWeb opened this issue Sep 24, 2023 · 6 comments
Open

Building from sources failed on Mac #673

ShogunWeb opened this issue Sep 24, 2023 · 6 comments

Comments

@ShogunWeb
Copy link

ShogunWeb commented Sep 24, 2023

Hi,

When building Audiveris on my Mac, I have this error :


FAILURE: Build failed with an exception.

  • Where:
    Settings file '/Users/jeremiefays/audiveris/settings.gradle'

  • What went wrong:
    Could not compile settings file '/Users/jeremiefays/audiveris/settings.gradle'.
    startup failed:
    General error during conversion: Unsupported class file major version 64


I have openjdk version "20.0.2" installed on my Mac, and Gradle 8.3

Could it be due to having a later version than java 17 installed on my computer ? Also, I see that even though Gradle 8.3 is installed on my computer, the build starts by installing gradle 7.3 (which is perhaps incompatible with java 20)

Any idea on hom to solve this problelm ?

@hbitteur
Copy link
Contributor

Gradle 7.3 comes from the file ./gradle/wrapper/gradle-wrapper.properties in your project directory.
But I don't think this is the problem.

You should try to use Java 17 instead of Java 20.

@CaTwoPlus
Copy link

CaTwoPlus commented Feb 11, 2024

Using Java 17 works when getting "Unsupported class file major version 65"!

@hbitteur
Copy link
Contributor

FYI:

  • on the "development" branch, we today use Gradle 8.5 and Java 21.
  • this does not apply yet to the "master" branch (and to the installed version of course, because it is always based on the master branch). On this branch we are still with Gradle 7.3 and Java 17.

@jamesellinger
Copy link

jamesellinger commented Mar 19, 2024

I built the latest development branch on an Apple M1 Pro running Sonoma 14.3.1

Gradle 8.6
Java 21.0.2

Seems to work well as far as I can tell as I was able to convert a PDF to musicXML.

However, I get the following messages in the console:

No OCR is available! Check log file for more details

and

Unable to setup Mac OS X GUI Integration

20240319T211159.log

@hbitteur
Copy link
Contributor

@jamesellinger

1/ Regarding the problem with OCR, the very beginning of your log file says:

2024-03-19 21:11:59,226 INFO [] TesseractOCR 116 | TESSDATA_PREFIX value: null
2024-03-19 21:11:59,226 WARN [] TesseractOCR 344 | Tesseract data could not be found. Try setting TESSDATA_PREFIX environment variable to point to tessdata folder.
2024-03-19 21:11:59,226 INFO [] TesseractOCR 241 | OCR folder: null

In plain English, the Tesseract library could not find the needed language data files.
Please have a look at this handbook section which explains how to download these language data files to some location of yours, and then set TESSDATA_PREFIX environment variable so that it points to your chosen location.
You are not the first to be bitten by this! A real fix is still on my own TODO list, see issue #692.

2/ Regarding the problem with Mac environment, the log file gives:

2024-03-19 21:11:59,815 WARN [] MacApplication 220 | Unable to setup Mac OS X GUI integration
java.lang.IllegalAccessException: class org.audiveris.omr.ui.MacApplication cannot access class com.apple.eawt.Application (in module java.desktop) because module java.desktop does not export com.apple.eawt to unnamed module @673ba40c

I personally don't have access to a Mac, so I can't help you directly here. But the error message looks familiar. This appeared with Java 9, when the Java implementation was reorganized, with a stronger "protection" against access to the internal modules. Of course, not all software around the world could instantly adapt to the new rules.
To get around this, you must sign a kind of “waiver.”

See these lines in the file build.gradle located at the root of Audiveris project, around line 71:

// Needed to circumvent the limitations brought by Java 9 and above (the JigSaw cuts)
applicationDefaultJvmArgs = ["--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED"]

I suppose you have to use something similar, perhaps:

applicationDefaultJvmArgs = ["--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED"]

But, like I said, I cannot check by myself.
So, please give it a try and let us know about the results.

@jamesellinger
Copy link

jamesellinger commented Mar 21, 2024

Thank you!

Regarding OCR, that's on me since I should have read the handbook more closely.

Regarding the second issue, changing line 71 in build.gradle to

applicationDefaultJvmArgs = ["--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED"]

did not change the error message. I saw that you posted the same suggestion in #564 a few months ago. Whatever the source is, it's still unresolved (I also just compiled Audiveris on an older Intel-based apple and get the same error).

Anyway, as I said it doesn't seem to have an impact on function. I can open PDFs and export to .mxl. I appreciate your work creating and maintaing this software.

Screenshot 2024-03-21 at 15 30 52

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

4 participants