The cmake output always shows NO for Java. I tried this on fresh minimal Ubuntu 24 installs while making sure that all packages necessary packages are installed and up to date. And I tried with Linux subsystem on Windows 10. If you have any ideas to getting the Java part build, too, please let me know.
But I wasn’t able to figure out what it does to find the package, or in what folders it looks for Java, jdk or jre.
Ramblings
Also I think if I install Java from Oracle I will have to pay a license fee. But that’s besides the point anyways. Also when Ubuntu offers commands to install Java, it only shows apt install commands with OpenJDK. From version 8 to 21. I very much believe that OpenJDK can be used to get a build with the file libopencv_java490.
If anyone was able to build OpenCV 4.9 using OpenJDK 8, 11 or later on Linux, please be so kind and share your commands.
Thanks for digging into the source files. When I run this command update-alternatives --list java on my Linux boxes running Ubuntu 20 and 24 I get resuluts like: /usr/lib/jvm/java-21-openjdk-amd64/bin/java or /usr/lib/jvm/java-11-openjdk-amd64/bin/java
I just checked and I was able to verify the paths for all files. So for libawt.so, libjvm, and also the include folder. It exists in Java 11, no longer in Java 21. But since I was running the cmake command with all the paths on a ubuntu box with Java 11 installed and set as the default Java installation, it should have been alright. Or at least as far as I can tell. My knowledge is minimal on how to use cmake or how to build OpenCV.
mine, too _;(
however, i’d argue, that you have to convince cmake somehow to accept your (custom) openjdk install
(it’s not really an OpenCV specific problem)
did you check, if it returns the correct $VERSION string ?
maybe it needs to set JAVA_HOME or similar ?
not sure, if those vars you set are actually used to find your sdk