Open thelou1s opened 2 years ago
@thelou1s
The code seems to be correct (you can also simply use File("").absoluteFile
since JVM resolves relative paths relative to a working directory). However, I'm not sure, what do you expect a working directory of a graphical application to be?
A working directory "is typically the directory in which the Java virtual machine was invoked." When launched from a console, it will be a normal terminal emulator's working directory.
However, usually graphical applications are launched via some other application (e.g. Finder on macOS, explorer on Windows). In that case, a working directory may be a working directory of a "parent" application (but generally it seems to be platform specific).
Could you provide more details about your use case?
I build a new Compose Crossplatform project, and copy old code into it. Then "File(System.getProperty("compose.application.resources.dir"))" just got the right path.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
I wanna get current working dir, in order to call some commands. I copied code from jetpack compose desktop lib's demo, but got wrong dir("/"). Could any one tell me what's the problem? thank you.
(jetpack compose desktop lib: https://github.com/JetBrains/compose-jb/blob/master/tutorials/Native_distributions_and_local_execution/README.md)