las2peer icon indicating copy to clipboard operation
las2peer copied to clipboard

[ENH] Use javac from JAVA_HOME in gradle build

Open Michi03 opened this issue 3 years ago • 0 comments

  1. Motivation - The gradle build files of the respective las2peer components define their own compile tasks, which call the java compiler (javac). This itself is fine, however depending on the context this can lead to unexpected problems which might be very hard to detect, since we don't use the javac binary from the JAVA_HOME directory, as one would expect. The resulting error looks like this:
> Task :core:compileJava FAILED
error: invalid source release: 17
Usage: javac <options> <source files>
  1. Specification - This should be rather easy to fix by replacing javac in the compile java task (here, here, and here ) with a reference to the JAVA_HOME variable. There are multiple ways to achieve this, discussed in this thread. Just take care that the build also still works if the variable isn't set.
  2. Finalised state - The las2peer build should then use the java compiler pointed to by the JAVA_HOME environment variable, if it is set.

Michi03 avatar Jan 26 '22 15:01 Michi03