[Github-comments] [geany/geany] Error trying to compile Kotlin w/ kotlinc..... (Issue #3138)

Robert Di Pardo notifications at github.com
Tue Mar 29 00:09:50 UTC 2022


@Dragaan,
> I just changed it from kotlinc to kotlinc.bat in my build options. VOILA! Problem solved.

I forgot to mention it, but a crucial detail is whether or not a `JAVA_HOME` environment variable has been set, e.g.

    > set | findstr JAVA
    JAVA_HOME=C:\Users\Rob\scoop\apps\ojdkbuild8\current

Remember that `kotlinc` is not a true executable; it's a library which the JVM has to find and load before it can process any source files. It was most likely the path to `java.exe` that wasn't being resolved. Explicitly calling the Batch script works because it sets up the environment for you:

~~~batch
:: %USERPROFILE%\android-studio\plugins\Kotlin\kotlinc\bin\kotlinc.bat
if not "%JAVA_HOME%"=="" (
  rem Prepend JAVA_HOME to local PATH to be able to simply execute "java" later in the script.
  set "PATH=%JAVA_HOME%\bin;%PATH%"
)
~~~

On Linux, the path to `JAVA_HOME` is permanently set by a CLI installer like [SDKMAN!](https://sdkman.io) (which I used in my second example above).


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3138#issuecomment-1081268910
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/3138/1081268910 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220328/a580d84d/attachment.htm>


More information about the Github-comments mailing list