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

compilation failure: cannot find symbol (openjdk 23.0.1, maven 3.9.9, macos 15.2) #11167

Open
ds-cbo opened this issue Jan 7, 2025 · 2 comments

Comments

@ds-cbo
Copy link

ds-cbo commented Jan 7, 2025

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project languagetool-core: Compilation failure: Compilation failure:
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[84,54] cannot find symbol
[ERROR]   symbol:   method getVersion()
[ERROR]   location: variable OS of type org.languagetool.LtBuildInfo
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[92,57] cannot find symbol
[ERROR]   symbol:   method getBuildDate()
[ERROR]   location: variable OS of type org.languagetool.LtBuildInfo
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[101,59] cannot find symbol
[ERROR]   symbol:   method getShortGitId()
[ERROR]   location: variable OS of type org.languagetool.LtBuildInfo
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[607,20] cannot find symbol
[ERROR]   symbol:   method isTrustedSource()
[ERROR]   location: variable userConfig of type org.languagetool.UserConfig
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[911,118] cannot find symbol
[ERROR]   symbol:   method getRuleMatches()
[ERROR]   location: class org.languagetool.CheckResults
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[1030,38] cannot find symbol
[ERROR]   symbol:   method getRuleMatches()
[ERROR]   location: variable res of type org.languagetool.CheckResults
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[1059,45] cannot find symbol
[ERROR]   symbol:   method getIgnoredRanges()
[ERROR]   location: variable res of type org.languagetool.CheckResults

running on macOS 15.2 (M1 chip) after the following commands:

% cd /tmp
% git clone --depth 5 https://github.com/languagetool-org/languagetool.git
% cd languagetool
% arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
% eval $(/usr/local/bin/brew shellenv)
% arch -x86_64 brew install openjdk
% arch -x86_64 brew install maven
% rehash

% mvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /usr/local/Cellar/maven/3.9.9/libexec
Java version: 23.0.1, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/23.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "15.2", arch: "x86_64", family: "mac"

% java --version
openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment Homebrew (build 23.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 23.0.1, mixed mode, sharing)

% ./build.sh languagetool-standalone package -DskipTests

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 15.2
[INFO] os.detected.version.major: 15
[INFO] os.detected.version.minor: 2
[INFO] os.detected.classifier: osx-x86_64
...
[INFO] Compiling 338 source files to /private/tmp/languagetool/languagetool-core/target/classes
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java: Some input files use or override a deprecated API.
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java: Recompile with -Xlint:deprecation for details.
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/tools/Tools.java: /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/tools/Tools.java uses or overrides a deprecated API that is marked for removal.
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/tools/Tools.java: Recompile with -Xlint:removal for details.
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/Language.java: Some input files use unchecked or unsafe operations.
[INFO] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/Language.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /private/tmp/languagetool/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java:[84,54] cannot find symbol
  symbol:   method getVersion()
  location: variable OS of type org.languagetool.LtBuildInfo
...
@janhun-ec
Copy link

Hi, I had similar issues with java 23. I downgraded to java 17, recompiled and reinstalled with mvn, and now it works.

@ds-cbo
Copy link
Author

ds-cbo commented Jan 22, 2025

@janhun-ec Thanks, that did the trick. For future readers, a workaround:

sudo brew install openjdk@17
export JAVA_HOME=`/usr/libexec/java_home -v 17`

then run build.sh again

(Worked with the ARM binaries, did not need the arch -x64 trick)

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

2 participants