I am having the same identical issue as this 'closed' thread - https://github.com/geany/geany/issues/2922
Can anyone explain?
my reply to the original post -
" I've been using Geany for a LONG time (~10yrs) and I am easily able to get it configured to compile/build/execute ALL of my other languages (c, c++ (w/ many compilers), java, pascal, javascript (via node), several basics, python, ruby, Go (pauses for like 5-15sec oftentimes, but still works), Fortran.... I THINK that's it..
Anyway, I've obviously got the process down pat, but the kotlinc command-line compiler just refuses to work in Geany. Works just fine in any terminal/command prompt (cmd, powershell, cmder, etc.). Path is set. Geany just seems to ignore it. No sound or anything, just "Process failed (The system cannot find the file specified)"
Kotlinc also works with the plugin I use for the Atom editor (plugin to compile+run most languages in a new cmd/terminal window). Geany just refuses to acknowledge the compiler's existence for whatever reason. I am NOT using the newest version of Geany (I use 1.36 because I do not like the new gtk3 version), although I see no reason why that would make a difference...
Without any information its not possible to help you. Nobody that I know of uses the combination you use, so you have to provide full information about your install, where kotlinc is installed to (full path) the PATH variable contents, which directory you run Geany in, how you start Geany.
To be clear Geany just calls the windows `CreateProcessW()` function, and the error message comes from that. You say it works for every other language, so it would seem something is weird about the kotlin compiler or your setup.
well it wasn't just me (going off other post where OP had the exact same issue). Have you tried using the kotlin compiler with Geany?
Have you tried using the kotlin compiler with Geany?
Nobody that I know of uses the combination you use.
To perhaps be clearer, nobody among the regular Geany contributors uses the combination of Windows 10, Geany 1.36 and kotlinc. In fact AFAIK none of them use Geany on Windows day to day, or Kotlin at all. Therefore either some other Kotlin user may help you if they have solved the problem, or you have to provide sufficient information for people to help you without having your configuration. Its very unlikely that volunteers will set up an unusual configuration just to test this issue.
@Dragaan,
Copying and pasting the full path to `kotlinc` seems to work.
![win11_kotlinc_ok](https://user-images.githubusercontent.com/59004801/159611091-a90920bc-8fd2-4...)
Geany 1.36 Windows 10.0.22000.588 kotlinc-jvm 1.5.20-release-289 (JRE 1.8.0_322-b06)
Windows path resolution is to blame: a working setup is trivial to achieve on Linux.
![buster_kotlinc_ok](https://user-images.githubusercontent.com/59004801/159611660-f87d72b1-7b39-4...)
Geany 1.33 Debian Buster kotlinc-jvm 1.6.10 (JRE 17.0.2+8)
@rdipardo Hah....weird. I just noticed you were using the "kotlinc.bat" file from android studio and not the kotlinc obtained from the jetbrains kotlin site. I actually just installed android studio the other day and wasn't aware of that file. Before even trying your suggestion of using the full path, instead I just changed it from kotlinc to kotlinc.bat in my build options. VOILA! Problem solved.
I don't know what the issue with geany and kotlinc is, but i find it to be pretty odd, as kotlinc is in my path and works just fine from the command line and in other code editors like atom. Me using Geany 1.36 may be odd, but (although they didn't say) chances are the OP in the other post who had the exact same issue as me wasn't using the same old version I am. I'm not a pro developer or anything. I've been slowly teaching myself bits of different languages over the years and just never encountered anything like this. I'm glad there was an easy solution to this, though! Thanks for the responses.
Closed #3138.
@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).
Great!
Please, don't close this issue.....
The information about kotlinc and kotlinc.bat and JAVA_HOME can help a lot of people....
thanks!
@jmpessoa its already closed, that does not prevent anyone accessing it, and you were even able to post to it.
github-comments@lists.geany.org