JetBrains / jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Apache License 2.0
634 stars 30 forks source link

Sample standalone code does not build on Windows 10 #414

Open askolt opened 1 week ago

askolt commented 1 week ago

I tried run the sample code and got an error

Exception in thread "main" java.lang.NoClassDefFoundError: org/jetbrains/jewel/samples/standalone/view/ComponentsViewKt (wrong name: org/jetbrains/jewel/samples/standalone/view\ComponentsViewKt)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

In org/jetbrains/jewel/samples/standalone/reflection/Views.kt:44 just add a new line with replace \ to .. It's work fine for me.

    val fullyQualifiedClassName =
        packageName +
            f.absolutePathString().removePrefix(directory.absolutePathString())
                .dropLast(6) // remove .class
                .replace('/', '.')
                .replace('\\', '.') // for Win10
rock3r commented 1 week ago

Hi @askolt, I just tried running the sample on Windows 11 and it works just fine as it is on main:

image

I'm not sure what's going on, but I am not very inclined to making changes for issues I can't repro. Are you sure you're using the latest JBR to run? I don't know if it makes any difference, but it's the only factor at play here.

askolt commented 6 days ago

Maybe on Windows 11 it works, but on Windows 10 Home 22H2 got an error . 😅

rock3r commented 6 days ago

I don't have a way to test/validate the fix on W10, as I only have W11 — even work computers don't have W10 anymore 😅 But feel free to open a PR if that unblocks you