Execute permission on binary missing while building java project on intellij on windows
Answered
Hello,
Execute permission on binary goes missing while building java projects on intellij on windows, whereas same project build nicely on linux cli and ubuntu desktop version of intellij.
Is this known issue or some setting i need to enable on the windows or on the intellij IDEA. Below are the version details:
IntelliJ IDEA 2022.3.3 (Community Edition)
Build #IC-223.8836.41, built on March 10, 2023
Runtime version: 17.0.6+1-b653.34 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
Non-Bundled Plugins:
name.kropp.intellij.makefile (223.8214.6)
Docker (223.8836.46)
com.perl5 (2022.3.3)
Kotlin: 223-1.8.0-release-345-IJ8836.41
Thanks,
Ibrahim
Please sign in to leave a comment.
What happens exactly when you build your project? Are there any error messages in the build output? Please provide the entire stack trace if so.
Hello Arina,
Build goes through fine. But when untar the deliverables built on windows 11 from Intellij, binaries are missing execute permission. Whereas if i build the same project on linux cli & GUI, binaries have correct permission. (execute permission). This is serious issue for me.
What version of JDK is used to build the project on Windows? There should be an executable called jspawnhelper in the jre/lib subdirectory of that JDK's distro. Make sure it has proper executing permissions. If you're not sure which JDK is used, you can check all installations newer than version 11 on your machine.
Does it make a difference if you add -Djdk.lang.Process.launchMechanism=vfork to 'File | Settings | Build, Execution, Deployment | Compiler | Shared build process VM options' and restart the IDE?
I am using 1.8.0_352 version of JDK. (project requirement). I didn't find jspawnhelper executable anywhere on my system.
I tried adding -Djdk.lang.Process.launchMechanism=vfork to 'File | Settings | Build, Execution, Deployment | Compiler | Shared build process VM options' and restarted the my IDE but no luck.
Windows has no concept of executable permission (the executable permission in a unix concept).
When you use a compress tool/code to tar your build files, you check that a compress tool if has any way to set the execute permission for some file in it. In this case, you could add the executable permission to it.
Or you need to use a Linux environment (like WSL), to add executable permission, and tar it.
When using Linux, if the build files have the executable permission, the tar related tools would reserve the file permission when compressing on Linux so you get it automatically.
Hi All, It's an issue with the version of intellij. I have downgraded to 2022.1.4 and things are working fine for me. Adding this comment for the benefit of other
Would it possible to share a example of sample for investigating? So we could check why it doesn't work in the latest IDEA and improve it?