<p></p>
<p dir="auto"><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/Dragaan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Dragaan">@Dragaan</a>,</p>
<blockquote>
<p dir="auto">I just changed it from kotlinc to kotlinc.bat in my build options. VOILA! Problem solved.</p>
</blockquote>
<p dir="auto">I forgot to mention it, but a crucial detail is whether or not a <code>JAVA_HOME</code> environment variable has been set, e.g.</p>
<pre><code>> set | findstr JAVA
JAVA_HOME=C:\Users\Rob\scoop\apps\ojdkbuild8\current
</code></pre>
<p dir="auto">Remember that <code>kotlinc</code> 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 <code>java.exe</code> that wasn't being resolved. Explicitly calling the Batch script works because it sets up the environment for you:</p>
<div class="highlight highlight-source-batchfile"><pre><span class="pl-c"><span class="pl-c">::</span> %USERPROFILE%\android-studio\plugins\Kotlin\kotlinc\bin\kotlinc.bat</span>
<span class="pl-k">if</span> <span class="pl-k">not</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">%JAVA_HOME%</span><span class="pl-pds">"</span></span><span class="pl-k">==</span><span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span> (
  <span class="pl-c"><span class="pl-k">rem</span> Prepend JAVA_HOME to local PATH to be able to simply execute "java" later in the script.</span>
  <span class="pl-k">set</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">PATH</span><span class="pl-k">=</span><span class="pl-smi">%JAVA_HOME%</span>\bin;<span class="pl-smi">%PATH%</span><span class="pl-pds">"</span></span>
)</pre></div>
<p dir="auto">On Linux, the path to <code>JAVA_HOME</code> is permanently set by a CLI installer like <a href="https://sdkman.io" rel="nofollow">SDKMAN!</a> (which I used in my second example above).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/3138#issuecomment-1081268910">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4A5LAJ5XQOKJW75BLVCJC45ANCNFSM5RJAXUJQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ732AUICND6Y4YCWPTVCJC45A5CNFSM5RJAXUJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIBZNVLQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/issues/3138/1081268910</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/3138#issuecomment-1081268910",
"url": "https://github.com/geany/geany/issues/3138#issuecomment-1081268910",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>