byte-buddy: Unable to install agent with IntelliJ bundled SDK on MacOS
When using Bytebuddy within IntelliJ and bundled Java 11 on MacOS it caused the following exception:
Caused by: java.io.IOException: Cannot run program ""/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java"": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:669)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:601)
... 102 more
The culprit seems to be ByteBuddyAgent.java#L664
Additional Info:
IntelliJ Version 2019.3.1 (IU-193.5662.53)
bytebuddy 1.9.16
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 31 (14 by maintainers)
Commits related to this issue
- [#802] quote java process path when it contains a whitespace — committed to bitbrain/byte-buddy by deleted user 4 years ago
- [#802] fix quote by wrapping the full path — committed to bitbrain/byte-buddy by deleted user 4 years ago
I am wondering - could we fix this by changing the
quotefunction to only wrap quotes if the string it wraps does not contain quotes already? I guess this would add some implicit behaviour and may lead to side effects elsewhere… or we introduce a new method calledquoteIfNotQuoted- you get the idea.Alternatively, maybe replacing any whitespace characters with a path encoded equivalent might do the trick as well, have not tried it yet.
Weird. Currently I am experiencing the same issue as #732.
Environment: macOS 10.14.6
$JAVA_HOME = /Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home)$JAVA_HOME).Minimal reproducible example:
Without the
quote(), it runs fine.I guess the newer version of Byte Buddy seems to work correctly. Once I updated the versions of mockk and Mockito (which use Byte Buddy), the problem disappeared.
Oh, and I guess this issue is a duplicate of that one: https://github.com/raphw/byte-buddy/issues/732, which is closed already.
Thanks, maybe it’s Java version dependant, too. Does it work if you quote it? Try an older release where the quoting is still applied.