I have a Multiplatform Desktop/JVM project that in...
# multiplatform
r
I have a Multiplatform Desktop/JVM project that includes
println
statements that I can see when running in my IDE. When I do a full build using Gradle
packageDistributionForCurrentOs
and use the MSI to install, I can run the installed EXE from a terminal, but the terminal doesn't show the prints on stdout. Is there something in the Multiplatform build process that strips/suppresses
println
statements?
Looks like the same happens when I build with Gradle
createDistributable
Also can't get direct calls to
System.out.println
to work (once it's fully built)
e
I think it's just a Windows thing that exe's are either console apps (and always attach to a console) or are non-console apps (and don't have console access)
r
Ah, you seem to be right. Your added context led me to find this discussion highlighting the same problem when using Go: https://groups.google.com/g/golang-nuts/c/MM8bev1Wsdg?pli=1 I was hoping my application could be either GUI or CLI depending how it's invoked, but that seems to require separate compilations on Windows. Thanks for the pointer!
m
what about to use logger interface?
r
@Michal Landsman I don't think logging would do any better, since that would end up going to stdout in the end anyway, which Windows apparently shuts off unless it's compiled a special way. I could definitely send logs to a file or somewhere in the GUI, but those don't really work for an interactive CLI version of the application.
👍 1