I'm trying to debug a failing test on Windows wher...
# random
p
I'm trying to debug a failing test on Windows where I run a
.class
file from
java
. Maybe you'll spot what's wrong... details in the thread
1
the execution looks like this:
Copy code
java -cp C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes MainKt
and in
C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes
there are these files/dirs:`
Copy code
- C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\MainKt.class
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\META-INF
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\META-INF\main.kotlin_module
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\MutableMyClass.class
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\MyClass.class
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\MyClassCopyDslKt$copy$result$1.class
    - C:\Users\RUNNER~1\AppData\Local\Temp\Kotlin-Compilation13472995364104513328\classes\MyClassCopyDslKt.class
On MacOS/Linux, it works fine
on Windows, I'm getting
java.lang.ClassNotFoundException: MainKt
tried playing with kind of slashes, but it doesn't help
oh, I think the culprit is in separation of paths in classpath - I actually didn't include the other path in the executed command above. My code has
:
as separator, and on Windows it's illegal since we have e.g.
C:\
, so we need a semicolon. Trying it now
That was it
s
I work on a Windows app (because most people have that), but I develop it with a MacBook (because the experience is better). I stumble into these kind of issues all the time. 🫣
👍 1
p
As if Microsoft really, deliberately wanted Windows to be different in some areas... Like "we'll need extra support for Windows, so it's going to cost you" 😁
😄 1
c
Well there are a lot of reasons for this going way back and it's really hard to objectively say if : or ; is a better separator.