0

When im importing the opencv library into intellij I get a compile error saying: Error message

I have tried setting the SDK and project language level to 1.8 but it still shows the same error message. SDK and project language settings

What can I do to solve this issue?

Thomas
  • 87,414
  • 12
  • 119
  • 157
Potato
  • 13
  • 3
  • Welcome to SO. Please read [ask] and note the following: whenever possible don't post images of text but post the text itself. When posting images make sure they are [displayed in the post instead of just linked](https://meta.stackoverflow.com/questions/344851/how-do-you-add-a-screenshot-image-to-your-stack-overflow-post). – Thomas May 27 '19 at 14:57
  • "class file has wrong version 55.0, should be 52.0" tells you that your project expects Java 8 class files at most (version 52.0) but you provided Java 11 files (version 55.0) – Thomas May 27 '19 at 14:59
  • You have to use Java 11 or more recent for your project or you have to recompile OpenVC with JDK 8. – Oo.oO May 27 '19 at 14:59
  • @Oo.oO How do I recompile OpenVC with JDK 8 on mac? I installed it with homebrew – Potato May 27 '19 at 16:04
  • I solved this by completely deleting the Java JDK 11 from my computer and then recompiled openVC with homebrew :) – Potato May 27 '19 at 17:42

1 Answers1

2

I think OpenCV libraries are compiled using java version 11 and not java 8. Please refer the link below for the class version corresponding java version. Or you can use jdk and jre 11 for the compilation and runtime. List of Java class file format major version numbers?

arunsrajan
  • 46
  • 2