I attempted to use OR-Tools installed from binary (for Java, on Mac) in a local project, and encountered an error in compilation. Error below:
bad class file: /Users/david.kennedy/Downloads/or-tools_MacOsX-10.14.2_v7.0.6546/lib/com.google.ortools.jar(com/google/ortools/graph/LinearSumAssignment.class)
class file has wrong version 54.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.`
The instructions state you need jdk 7, and i have jdk 8, but it seems like the jar was built with jdk 10
cat MANIFEST.MF
Manifest-Version: 1.0
Created-By: 10.0.1 (Oracle Corporation)
We should be building using jdk8.
If not, it is a bug. We will check.
Thanks
Laurent Perron | Operations Research | [email protected] | (33) 1 42 68 53
00
Le ven. 12 avr. 2019 Ã 17:06, David Kennedy notifications@github.com a
écrit :
I attempted to use OR-Tools installed from binary (for Java, on Mac) in a
local project, and encountered an error in compilation. Error below:bad class file:
/Users/david.kennedy/Downloads/or-tools_MacOsX-10.14.2_v7.0.6546/lib/com.google.ortools.jar(com/google/ortools/graph/LinearSumAssignment.class)
class file has wrong version 54.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the
classpath.`The instructions
https://developers.google.com/optimization/install/java/mac state you
need jdk 7, and i have jdk 8, but it seems like the jar was built with jdk
10cat MANIFEST.MF
Manifest-Version: 1.0
Created-By: 10.0.1 (Oracle Corporation)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1191, or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17abMJ-FqzJcAFAE737JS-GrfL0Bnks5vgR-AgaJpZM4ctu4P
.
When performing a brew update, I got Java 12 (which is the current default)
On my way to setup java8.
dev note:
# check java version available
brew tap caskroom/versions
brew search java
# Install JDK 8
brew cask install java8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-8-latest/Contents/Home
java -version
# Makefile.local contains JAVa_HOME so need to suppress it by
make clean_third_party
# OR
rm Makefile.local
make detect_java
# Otherwise you can force it on cli since GNU/Make cli args have precedences over Makefile...
make detect_java JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-8-latest/Contents/Home
WARNING: /usr/libexec/java_home don't care about JAVA_HOME
@unfuse I've just re-uploaded archive which should have been built against brew cask java8 package
Thanks much! I noticed that the download link from the install site doesn't work anymore (https://github.com/google/or-tools/releases/download/v7.0/or-tools_MacOsX-10.14.2_v7.0.6546.tar.gz) - says not found. It looks like ...MacOsX-10.14.2... should be ...MacOsX-10.14.4...?
However, I tested by downloading it directly from https://github.com/google/or-tools/releases and built it with my local project and it works!
Thanks for the feedback, I'll try to fix the link on documentation ASAP.
EDIT: optimization link have been updated !