Open Love-Fat opened 2 years ago
Make sure you have java 1.8 installed, jdk9+ does not support the java -d64 and -d32 cmds, the "validate_java_exists" function relies on those to check 64? 32. Or just set that boolean in the cmake function to just be true.
Currently spent a couple days trouble shooting this error on an ubuntu20.04 machine trying to build ATAK in android studio.
32-bit Java specified while targeting a 64-bit build.
Call Stack (most recent call first):
src/main/jni/CMakeLists.txt:7 (validate_java_exists)
as stated in the comments of AndroidTacticalAssaultKit-CIV/takkernal/engine/cmake/support/ValidateJavaExists.cmake
# Due to an existing bug in the FindJNI module, FindJNI will not respect the JAVA_HOME CMake environment variable if a
# JDK is specified on the system PATH. Thus, if there are multiple JDKs on the system, the first JDK found in PATH
# will be validated against
this effectively makes setting JAVA_HOME useless
I located my java versions in the folder /usr/lib/jvm
and deleted everything but java-1.8.0-openjdk-amd64 and java-8-openjdk-amd64.
This fixed the error.
Having the same issue here. Ubuntu 20.04, trying to build ATAK (specifically, Gradle Sync) in Android Studio.
I deleted all other java versions (except java-1.8.0-openjdk-amd64 and java-8-openjdk-amd64) in /usr/lib/jvm
as mentioned by @jruroede but the issue persists on my end unfortunately. I've updated the Java JDK location both using $JAVA_HOME and via Android Studio.
Thinking about overwriting the cmake to just return true as mentioned above.
Can you post the exact error for me?
Also go to android studio and look in settings -> build, execution, deployment -> gradle and take a screenshot.
also post what your local.properties files looks like.
@jruroede
Error:
CMake Error at cmake/support/ValidateJavaExists.cmake:55 (message):
32-bit Java specified while targeting a 64-bit build.
Call Stack (most recent call first):
src/main/jni/CMakeLists.txt:7 (validate_java_exists)
Local Properties:
sdk.dir=/home/ryanalexander/Android/Sdk
ndk.dir=/home/ryanalexander/Android/Sdk/ndk
cmake.dir=/home/ryanalexander/ATAK/CMAKE_for_ATAK
takDebugKeyFile=debug.keystore
takDebugKeyFilePassword=android
takDebugKeyAlias=androiddebugkey
takDebugKeyPassword=android
takReleaseKeyFile=...
takReleaseKeyFilePassword=...
takReleaseKeyAlias=...
takReleaseKeyPassword=...
(I only intend to use debug for now, I'll set the release key later.)
Gradle - I couldn't find the settings under "Build, Execution, Deployment" but I'll show where I select a Java option as well as my /usr/lib/jvm
folder:
On Ubuntu 22.04 I managed to solve this without removing system-installed JDKs by using
sudo update-alternatives --config java
32-bit Java specified while targeting a 64-bit build. Call Stack (most recent call first): src/main/jni/CMakeLists.txt:7 (validate_java_exists)