Skip to content

Incompatible Java versions? #215

@algebravic

Description

@algebravic

I just did a git clone of mallet. At first I had a problem with a mismatch since I'm running on mac OS, and the default java there is almost 8 years old! I then used homebrew to install openjdk and was careful to update environment variables so that the programs and libraries would be found before the defalt MacOS versions. I'm actually using mallet as called by the program topics. The latter extracts a bunch of text files from pdf files and puts them in a subdirectory. Any suggestions as to how to fix this? Below is an example of the problem.

./mallet/bin/mallet import-dir --input txt
Labels = 
   txt
Exception in thread "main" java.lang.NoClassDefFoundError: com/carrotsearch/hppc/ObjectIntHashMap
        at cc.mallet.types.Alphabet.<init>(Alphabet.java:61)
        at cc.mallet.types.Alphabet.<init>(Alphabet.java:77)
        at cc.mallet.types.LabelAlphabet.<init>(LabelAlphabet.java:25)
        at cc.mallet.pipe.Target2Label.<init>(Target2Label.java:35)
        at cc.mallet.classify.tui.Text2Vectors.main(Text2Vectors.java:167)
Caused by: java.lang.ClassNotFoundException: com.carrotsearch.hppc.ObjectIntHashMap
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
        ... 5 more

Here's the versions of the various software I'm using:

java --version
openjdk 25.0.1 2025-10-21
OpenJDK Runtime Environment Homebrew (build 25.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 25.0.1, mixed mode, sharing)
mvn --version
Apache Maven 3.9.12 (848fbb4bf2d427b72bdb2471c22fced7ebd9a7a1)
Maven home: /opt/homebrew/Cellar/maven/3.9.12/libexec
Java version: 25.0.1, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/25.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "26.2", arch: "aarch64", family: "mac"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions