Hi, I've encountered a weird issue and I'm not sur...
# fleet
b
Hi, I've encountered a weird issue and I'm not sure if it is really an issue or I'm just not understanding something I've created my project with the https://kmp.jetbrains.com/ wizard with Android iOS and Desktop targets. I've noticed that the desktop target, declared by
jvm("desktop")
in the Gradle file, does not have access to the JVM classes. By default there is directory
desktopMain
in my module and it does not have access to JVM classes. It only works once I rename the directory to
jvmMain
, but then the project won't build as it looks for the
desktopMain
directory for
actual
declarations. I thought it is a multiplatform Gradle setup issue, but then I've decided to open my project with latest stable Android Studio. It turned out that it actually has access to JVM classes from
desktopMain
directory. I came to conclusion that the only thing that differs between my Fleet and Android Studio is that AS uses Jetbrains Runtime JDK 17.0.11, and my Fleet was using the JDK from
JAVA_HOME
which was OpenJDK 17.0.14 installed with Homebrew. I've switched the JDK in fleet from OpenJDK to JBR and it magically started to have access to JVM classes in
desktopMain
directory mind blown Is this an issue? Why the JDK used matters in here? Because it looks like a bug to me
g
Is it really doesn't have access to JVM classes (so it builds from command line) or it's an IDE issue?
I don't think it's related to Java distribution btw
b
so it seems that overall project builds both in Fleet and command line, so it is purely IDE issue also one more obervation, it is tied to the selection of
JAVA_HOME
as JDK for IDE, because when I specifically select my OpenJDK installation it works as intended, but when I select
JAVA_HOME
it does not work even tho the IDE detects it as my OpenJDK installation correctly 🤔 I set my
JAVA_HOME
in my
.zshrc
file so it is maybe connected
I guess I need to create an issue for that