Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devonfw-ide regression: cannot launch intellij #808

Closed
hohwille opened this issue Nov 25, 2024 · 1 comment · Fixed by #852
Closed

devonfw-ide regression: cannot launch intellij #808

hohwille opened this issue Nov 25, 2024 · 1 comment · Fixed by #852
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

Expected behavior

As a devonfw-ide user, I want to be able to use IDEasy in my existing project so that I can test if it works better.

Actual behavior

$ ide intellij
Both legacy variable MAVEN_VERSION and official variable MVN_VERSION are configured in D:\projects\example-project\settings\devon.properties - ignoring legacy variable declaration!
Start: Configuring workspace main for IDE intellij
Successfully ended step 'Configuring workspace main for IDE intellij'.
Step 'ide (intellij)' failed: java.lang.IllegalStateException: Running command 'intellij' with arguments 'C:\Program Files\Git\bin\bash.exe' '-c' '/d/projects/example-project/workspaces/main & disown' failed: Cannot run program "intellij": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
1 step(s) failed out of 4 steps.
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/IDEasy/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=IllegalStateException%3A+Running+command+%27intellij%27+with+arguments+%27C%3A%5CProgram+Files%5CGit%5Cbin%5Cbash.exe%27+%27-c%27+%27%2Fd%2Fprojects%2Fexample-project%2Fworkspaces%2Fmain+%26+disown%27+failed%3A+Cannot+run+program+%22intellij%22%3A+CreateProcess+error%3D2%2C+Das+System+kann+die+angegebene+Datei+nicht+finden
java.lang.IllegalStateException: Running command 'intellij' with arguments 'C:\Program Files\Git\bin\bash.exe' '-c' '/d/projects/example-project/workspaces/main & disown' failed: Cannot run program "intellij": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
        at com.devonfw.tools.ide.process.ProcessContextImpl.run(ProcessContextImpl.java:204)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:169)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:152)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.runTool(IdeToolCommandlet.java:55)
        at com.devonfw.tools.ide.tool.ToolCommandlet.run(ToolCommandlet.java:130)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.run(IdeToolCommandlet.java:49)
        at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:860)
        at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:767)
        at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:89)
        at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:52)
        at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:29)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.io.IOException: Cannot run program "intellij": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
        at [email protected]/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
        at [email protected]/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
        at com.devonfw.tools.ide.process.ProcessContextImpl.run(ProcessContextImpl.java:173)
        ... 11 more
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$NewObjectWithObjectArrayArgFunctionPointer.invoke(JNIFunctions.java)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.ThrowNew(JNIFunctions.java:907)
        at [email protected]/java.lang.ProcessImpl.create(Native Method)
        at [email protected]/java.lang.ProcessImpl.<init>(ProcessImpl.java:500)
        at [email protected]/java.lang.ProcessImpl.start(ProcessImpl.java:159)
        at [email protected]/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
        ... 13 more

Error: IDEasy failed with exit code 255

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. create a project with devonfw-ide
  2. ensure intellij is installed (devon intellij setup)
  3. install IDEasy if not already done
  4. run ide intellij on that devonfw-ide project

Related/Dependent Issues

Comments/Hints:

The problem is that we decided to simplify our commandlets and do quirks and workaround (if required) rather at the end of the installation (postExtract).
For IDEs that violate common best practices like having a launch command named like the tool name, we create a launch script as a wrapper during the installation.
While I still think that this is a valid approach, we did not yet think about the following problems:

  • the tool was installed by devonfw-ide rather than by IDEasy
  • the tool was installed by an earlier release of IDEasy that did not create the launch script as expected

A first thought would be to always check for the binary before running it:

  • if it exists but is lacking executable permissions on non Windows systems, we should consider logging a warning and then add the executable flag before running it
  • if it does not exist, we should consider logging a warning and rerunning our postExtract hook on the installation directory. This should then "repair" the installation from IDEasy perspective.

Please note that this bug/issue is not only about intellij but a general aspect for installing and running (local) tools.

Affected version:

  • 2024.12.001-beta-SNAPSHOT
@hohwille
Copy link
Member Author

As a workaround at least #809 would be helpful.

@hohwille hohwille linked a pull request Dec 9, 2024 that will close this issue
@hohwille hohwille added this to the release:2024.12.001 milestone Dec 9, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in IDEasy board Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant