0

I'm trying to build QuestDB from source on a newly setup machine and I get warnings about javac:

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ questdb ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1292 source files to /home/pi/questdb/core/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.

What's a fix for this?

djbobo
  • 487
  • 2
  • 6

1 Answers1

2

It looks like JAVA_HOME env var is not set. You can check by running the following in your shell:

echo $JAVA_HOME

On macOS, I have the following:

/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home

To check which runtime maven (brew install) is referencing:

mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/me/maven/apache-maven-3.6.3
Java version: 11.0.9, vendor: Oracle Corporation, runtime: /usr/local/Cellar/openjdk@11/11.0.9/libexec/openjdk.jdk/Contents/Home

In ~/.zshrc (you may use ~/.bashrc) I have set JAVA_HOME with

export JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home"

then try building again:

source ~/.zshrc
mvn clean package -DskipTests -P build-web-console,build-binaries
Brian Smith
  • 1,222
  • 7
  • 17