Complete noob to Java compilation here. Wanted to build filebot for personal usage.
The build script I'm using is, from here:
@echo off
cd /D %~dp0
set PATH=%WIX%\bin;%PATH%
if not defined JAVA_HOME (set JAVA_HOME=C:\Program Files\Java\jdk-9.0.4)
echo Downloading dependencies...
call ant resolve
echo:
echo Compiling...
call ant fatjar
echo:
echo Building MSI installer...
call ant msi
if not defined WORKSPACE pause
I have installed WiX Toolset, Apache Ant, Apache Ivy, and JDK 9.0.4 (as the original filebot has stopped using JDK 8). Added the Ant/bin folder to user path, and copied ivy.jar to that folder. Also set JAVA_HOME to jdk folder.
Worth noting, I had jre9.0.4 earlier, and installed jdk on top of that. After some googling, found that jre also copies some files to System32 folder, and that the remedy is to have jdk/bin folder as the topmost entry in Path variables. But this has not solved the error.
The main problem that I'm facing is that, after downloading the dependencies, during the Compilation stage, I get the following output:
[javac] Compiling 395 source files to D:\Misc\filebot\build
[javac] javac: release version 10 not supported // I believe this is the culprit
[javac] Usage: javac <options> <source files>
[javac] use --help for a list of possible options
BUILD FAILED
And after this, the msi build also fails. The relevant build.xml
part is:
<javac srcdir="${dir.source}" destdir="${dir.build}" release="${jvm.version}" encoding="utf-8" debug="yes" debuglevel="lines,vars,source" includeAntRuntime="no">
<classpath>
<fileset dir="${dir.dist}/lib" />
</classpath>
</javac>
I could not find any relevant info about the version 10 not supported
part on Google, and also haven't installed jdk 10.
javac -version
gives javac 9.0.4
I'm very new to Java compilation, and may have missed something trivial. TIA :)
As I thought, I'd missed something trivial. filebot has moved to jdk 10, which is why the error was being shown when I was trying to compile with jdk 9.
So, to anyone facing a similar problem, make sure the target JDK of the source you're building is the same as your development kit version.