Build Failure from Source

Hi, I am trying to build kotlin compiler from the source code. I have ant installed and these variables set:
JAVA_HOME=“path to JDK 1.8”
JDK_16=“path to JDK 1.6”
JDK_17=“path to JDK 1.7”
JDK_18=“path to JDK 1.8”

On running “ant -f build.xml”, I get these error at “gradle-runtime” build step:

[gradle] [KOTLIN] Received unexpected message from compiler daemon: category=0, severity=2, message=‘kotlinc-jvm @snapshot@ (JRE 1.8.0_102-b14)’, attachment=null

[gradle] [KOTLIN] Received unexpected message from compiler daemon: category=0, severity=1, message=‘Advanced option value is passed in an obsolete form. Please use the ‘=’ character to specify the value: -Xdump-declarations-to=…’, attachment=null

[gradle] [KOTLIN] Received unexpected message from compiler daemon: category=0, severity=0, message=‘No class roots are found in the JDK path: /Library/Java/JavaVirtualMachines/1.6.0.jdk’, attachment=null

[gradle]
[gradle] FAILURE: Build failed with an exception.
[gradle]
[gradle] * What went wrong:
[gradle] Execution failed for task ‘:kotlin-stdlib:compileBuiltinsKotlin’.
[gradle] > Compilation error. See log for more details
[gradle]

More specifically it is failing at this command in stdlib/build.gradle:

compileBuiltinsKotlin {
kotlinOptions {
freeCompilerArgs = [
“-version”,
“-Xallow-kotlin-package”,
“-Xdump-declarations-to”, “${buildDir}/runtime-declarations.json”,
“-cp”, “${rootDir}/…/dist/builtins”,
“-module-name”, “kotlin-runtime”
]
}
}

Please let me know if any more info is needed. I have been trying to get it working for past three days, any help will be really appreciated. Thank you.

If you’re on Mac, probably you should set JDK paths as /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

1 Like

Thanks a lot. :sweat_smile: