question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install agent with IntelliJ bundled SDK on MacOS

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
bitbraincommented, Nov 15, 2021

I am wondering - could we fix this by changing the quote function 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 called quoteIfNotQuoted - 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.

2reactions
kcy1019commented, May 7, 2020

Weird. Currently I am experiencing the same issue as #732.

Environment: macOS 10.14.6

  • Idea 2019.2.3 with bundled Java 11. ($JAVA_HOME = /Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home)
  • Idea 2020.1.1 with Bundled Java 11 (same $JAVA_HOME).

Minimal reproducible example:

import java.io.*;

public class Main {
    private static String quote(String value) {
        return value.contains(" ")
                ? '"' + value + '"'
                : value;
    }
    public static void main(String[] args) throws IOException, InterruptedException {
        String s = System.getProperty("java.home");
        System.out.println(new ProcessBuilder(quote(s+"/bin/java")).start().waitFor());
    }
}
$ javac Main.java && java Main
Exception in thread "main" 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 Main.main(Main.java:10)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
        ... 2 more

Without the quote(), it runs fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install plugins | IntelliJ IDEA Documentation - JetBrains
Use the Installed tab to browse bundled and installed plugins, enable, ... You can disable bundled plugins, but they cannot be removed.
Read more >
IntelliJ IDEA - Connect and work with JetBrains Gateway
Ensure you have downloaded and installed JetBrains Gateway or an IDE with this bundled plugin on your local machine. Ensure you have an...
Read more >
SDKs | IntelliJ IDEA Documentation - JetBrains
A Software Development Kit, or an SDK, is a collection of tools that you need to develop an application for a specific software...
Read more >
Install and Start TeamCity Agents - JetBrains
A TeamCity build agent is a piece of software which listens for the commands from the TeamCity server and starts the actual build...
Read more >
mac os 12 beta6 Unable to start IDEA : JBR-3715
Here is my one-liner to patch Toolbox installed applications: find ~/Library/Application\ Support/JetBrains -name "*.vmoptions" | grep -v Contents | while ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found