Can anybody tell me why IntelliJ is not seeing any...
# compose-desktop
m
Can anybody tell me why IntelliJ is not seeing any classes in a jar of a Java project which is include like this in a Kotlin Compose multiplatform (Desktop+Android) project:
Copy code
val desktopMain by getting {
	dependencies {
		...
		implementation(files("../libs/org/deegree/deegree-core-commons-3.5.1-SNAPSHOT.jar"))
	}
}
The jar only works for the desktop part of my multiplatform project. That’s why I added it to dektopMain. When I try to use anything form that JAR (inside desktopMain of course) it gets red in the editor window. If however I do some blind flying and just let Gradle build and run the program, everything is fine. So it is once again just IntelliJ which gets everything wrong. I neither can nor want to work like this anymore. IntelliJ IDEA 2023.2.1 Preview (Community Edition) Build #IC-232.9559.10, built on August 10, 2023 Runtime version: 17.0.8+7-b1000.8 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 13.4.1 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 12 Metal Rendering is ON Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true Non-Bundled Plugins: com.intellij.javafx (1.0.4) org.rust.lang (0.4.200.5421-232) com.gluonhq.plugin.intellij (2.8.6) org.asciidoctor.intellij.asciidoc (0.38.20) com.squareup.sqldelight (2.0.0) androidx.compose.plugins.idea (232.9559.10) org.jetbrains.compose.desktop.ide (1.4.3) Kotlin: 232-1.9.0-IJ9559.10
a
Could the the working dir or project root is different in IntelliJ and a commandline gradle run.
What happens you specify an absolute path for that jar?
m
1. I didn’t run it via the command line. I let IntelliJ start the build and run via its gradle tasks. It is just the IntelliJ Editor which gets it all wrong. 2. I tried that before just to be sure and the result is the same.
a
Try clearing caches and such
m
I also tried removing the .idea and .gradle folders. Nothing changed.
s
Kotlin 1.9.20 is going to help you out here. May I ask why you are not using a maven repository in your case?
Which Kotlin Gradle Plugin version are you currently using?
m
1. I am looking forward to Kotlin 1.9.20 then 🙏 2. The code in question is not available on any maven repository and it’s also a modified version specifically for my project. So I want to keep these jars locally in my own repository. 3. I am using whatever the default Kotlin Gradle Plugin is for Kotlin 1.9.0.
s
2. The code in question is not available on any maven repository and it’s also a modified version specifically for my project. So I want to keep these jars locally in my own repository.
My personal advise would be to then publish your code to a repository (even if its just some folder on your machine) and organise it there. (Or use composite builds) 3. Hmm, there is no such thing as default Kotlin Gradle Plugin as you always need to be specific what version you build with. I assume you’re using 1.9.0. If you’re really blocked, I could spend a little of my free time to do a custom 1.9.0 build including code that would help you out?
m
Yes, but in the Compose Multiplatform Project template I use the
kotlin.version
is specified in the
gradle.properties
which is then picked up in
settings.gradle.kts
as
val kotlinVersion = extra["kotlin.version"] as String
which is then used to configure all Kotlin related plugins. This somehow makes it the default for me although technically you are of course right that I could also explicitly choose some other version. Thank you for the offer to spend some of your free time for me but I think I can wait for 1.9.20. As long as the code compiles (and that’s what it is doing right now) I think I can bridge the time until 1.9.20 is officially released. But thanks again for the generous offer cheers.