(cli) openfl build android
(long logs)
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I have already tried setting $JAVA_HOME to “/usr/lib/jvm/default-java” and “/usr/lib/jvm/java-17-openjdk-amd64/bin/java”.
But interestingly. The program still keeps insisting my “JAVA_HOME” env variable is set to “/usr/lib/jvm” even thought it’s not.
I have already closed and re-opened my terminal.
I have already tried “source ~/.bashrc” with JAVA_HOME being set to several different paths, and still nothing.
I have tried to “force it” like: “JAVA_HOME=(path…); openfl build android” but it seems it’s “getting” the env variables from somewhere else.
The “.env” file in the current directly does not exist so it can’t be it.
Here are some program output to help:
Vik@Vik: pts/0: 7 files 36Kb ❯ java --version
openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-121.04)
OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-121.04, mixed mode, sharing)
Vik@Vik: pts/0: 7 files 36Kb ❯ cat Build.xml
<xml> <set name="HXCPP_ARM64" value="1" if="android" /> <files id="hello"> <file name="Hello.cpp" /> </files> <target id="default" output="hello" tool="linker" toolid="${STD_MODULE_LINK}"> <outdir name="bin" /> <ext value="" /> <files id="hello" /> </target> </xml>
Vik@Vik: pts/0: 7 files 36Kb ❯ cat project.xml
<?xml version="1.0" encoding="utf-8"?> <project> <meta title="HelloWorldProject" package="com.sample.helloworldproject" version="1.0.0" company="Company Name" /> <app main="Main" path="Export" file="HelloWorldProject" /> <source path="Source" /> <haxelib name="openfl" /> <config:android build-tools-version="1" /> <assets path="Assets" rename="assets" /> </project>
Vik@Vik: pts/0: 7 files 36Kb ❯ haxe --version
4.1.5
Vik@Vik: pts/0: 7 files 36Kb ❯ echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-amd64/bin/java
Thanks.