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

Cannot launch IntelliJ with ìde intellij` #783

Closed
sven-binnig opened this issue Nov 21, 2024 · 13 comments · Fixed by #828
Closed

Cannot launch IntelliJ with ìde intellij` #783

sven-binnig opened this issue Nov 21, 2024 · 13 comments · Fixed by #828
Labels
bug Something isn't working

Comments

@sven-binnig
Copy link

Expected behavior

As a developer, I want to launch perviously installed intellij

Actual behavior

IntelliJ does not start:

C:\projects\test-project>ide intellij
Skipping git fetch on C:\projects\test-project\settings because we are offline.
←[93mExpected folder was not found at C:\projects\test-project\settings\intellij\workspace\setup←[0m
←[35mStart: Configuring workspace main for IDE intellij←[0m
←[92mSuccessfully ended step 'Configuring workspace main for IDE intellij'.←[0m
Skipping git pull/clone on C:\projects\_ide\urls because we are offline.
Successfully completed ide (intellij)
C:\projects\test-project\software\intellij\bin\intellij: line 2: dirname: command not found
C:\projects\test-project\software\intellij\bin\intellij: line 2: /idea64.exe: No such file or directory
Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project\settings because we are offline." ist nicht definiert.

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

Related/Dependent Issues

Comments/Hints:

Affected version:

  • OS: Windows 10
  • Browser: -
@sven-binnig sven-binnig added the bug Something isn't working label Nov 21, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Nov 21, 2024
@hohwille
Copy link
Member

@sven-binnig thanks for reporting this bug.
IMHO we have fixed this problem with PR #784.
As discussed in issue #764 there root of the bug is still not fully fixed but we are on our way.
You can go to our snapshot-repo and download the latest nightly-build (currently this) and install it as update of IDEasy (use 7-Zip and extract it on top of your $IDE_ROOT/_ide folder overriding all files.
Then please rerun ide intellij from CMD and let us know if the bug is fixed or still appears.

@hohwille hohwille added this to the release:2024.12.001 milestone Nov 22, 2024
@sven-binnig
Copy link
Author

@hohwille thanks for answering
Accoriding to other issues I have submitted (# 774) I achived a working installation while getting the zip-archive of the code and made an evil fix in AbstractIdeContext.isOnline().

I could try the snapshot as you have described ...

@sven-binnig
Copy link
Author

@hohwille
I have tried. Here are the results

C:\projects\test-project>ide --version
Skipping git fetch on C:\projects\test-project\settings because we are offline.
2024.12.001-beta-SNAPSHOT
Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project\settings because we are offline." ist nicht definiert.

So: I am using the current snapshot version.
But:

C:\projects\test-project>ide intellij
Skipping git fetch on C:\projects\test-project\settings because we are offline.
←[93mExpected folder was not found at C:\projects\test-project\settings\intellij\workspace\setup←[0m
←[35mStart: Configuring workspace main for IDE intellij←[0m
←[92mSuccessfully ended step 'Configuring workspace main for IDE intellij'.←[0m
Skipping git pull/clone on C:\projects\_ide\urls because we are offline.
Successfully completed ide (intellij)
C:\projects\test-project\software\intellij\bin\intellij: line 2: dirname: command not found
C:\projects\test-project\software\intellij\bin\intellij: line 2: /idea64.exe: No such file or directory
Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project\settings because we are offline." ist nicht definiert.

The same two errors and the strange error message Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project\settings because we are offline." ist nicht definiert. still exist.

@hohwille
Copy link
Member

Sorry forgot to mention: You need to delete intellij first to force a reinstall. E.g.

ide uninstall intellij
rm -rf $IDE_ROOT/_ide/software/default/intellij/

Then reruning ide intellij will reinstall intellij and also create an intellij.bat launch script on windows what will fix the bug.

@hohwille
Copy link
Member

Skipping git fetch on C:\projects\test-project\settings because we are offline.

Interesting. Are you offline while doing this test? I guess not. So our online/offline check seems to be problematic.
See also this one:
#754 (comment)

Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project\settings because we are offline." ist nicht definiert.

This bug should actually be fixed in the latest SNAPSHOT release.
On my machine I can confirm that this one is fixed - even in CMD:

ideasy -o env
...no messsage Skipping git fet ...

And

ideasy -d -o env
...
Skipping git fetch on D:\projects\IDEasy\settings because we are offline.
...

So the ide.bat script that calls ideasy env that should not cause this Skipping message anymore:

for /f "tokens=*" %%i in ('ideasy env') do (
call set %%i
)

We are also in the process to produce unique SNAPSHOT versions for each nightly build so we can distinguish the exact binary package that was installed by ide -v and OS/arch information.

@sven-binnig
Copy link
Author

Are you offline while doing this test? I guess not. So our online/offline check seems to be problematic.

The output of the command ide intellji says:
Skipping git pull/clone on C:\projects\_ide\urls because we are offline
I have tried to start intellji from the command line after i have setup a project with my fixed code, that ran in intellij

We are also in the process to produce unique SNAPSHOT versions for each nightly build so we can distinguish the exact binary package that was installed by ide -v and OS/arch information.

Output of ìde -v`:

C:\projects\test-project-2>ide -v
Skipping git fetch on C:\projects\test-project-2\settings because we are offline.
2024.12.001-beta-SNAPSHOT
Die Umgebungsvariable "Skipping git fetch on C:\projects\test-project-2\settings because we are offline." ist nicht definiert.

OS = Windows 10 Pro.

@sven-binnig
Copy link
Author

sven-binnig commented Nov 22, 2024

Sorry forgot to mention: You need to delete intellij first to force a reinstall.

When I try to reinstall intellij from command line, I get the offline-issue.
When I try to reinstall intellij during setting up a new project (with my code fixes), the reinstallation process works, but the error message is still the same. It seems to me that in the shellscript the variable $(dirname "$0") is missing.

The code i can find here is suitable to the SNAPSHOT i use?
I could retry and download the current code archive, reimplement my fix and try it again ...

@sven-binnig
Copy link
Author

@hohwille
I have change my test-choreography a bit.

  • uninstall intellij and remove the installation directory as you have adviced me
  • from the ide.properties from ~ I remove intellij from the variable IDE_TOOLS
  • created a new project and cd to the project folder

Then I startet
$ ideasy -Dhttp.proxyHost=${https_proxy} intellij and IntelliJ was coming up.

Here is the complete output of the commandlet

$ ideasy -Dhttp.proxyHost=${https_proxy} intellij
Skipping git fetch on C:\projects\test-project-2\settings because we are offline.
Expected folder was not found at C:\projects\test-project-2\settings\intellij\workspace\setup
Start: Configuring workspace main for IDE intellij
Successfully ended step 'Configuring workspace main for IDE intellij'.
Skipping git pull/clone on C:\projects\_ide\urls because we are offline.
Due to lack of permissions, Microsoft's mklink with junction had to be used to create a Symlink. See https://github.com/devonfw/IDEasy/blob/main/documentation/symlinks.asciidoc for further details. Error was: C:\projects\test-project-2\software\intellij: Dem Client fehlt ein erforderliches Recht
You are on Windows and you do not have permissions to create symbolic links. Junctions are used as an alternative, however, these can not point to relative paths. So the source (..\..\_ide\software\default\intellij\ultimate\2024.3) is interpreted as an absolute path.
Verbindung erstellt für C:\projects\test-project-2\software\intellij <<===>> C:\projects\_ide\software\default\intellij\ultimate\2024.3
Successfully installed intellij in version 2024.3
Successfully completed ide (intellij)

f0280414@T2888024 MINGW64 /c/projects/test-project-2
$ WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by com.intellij.platform.core.nio.fs.CoreBootstrapSecurityManager (file:/C:/projects/_ide/software/default/intellij/ultimate/2024.3/lib/nio-fs.jar)
WARNING: Please consider reporting this to the maintainers of com.intellij.platform.core.nio.fs.CoreBootstrapSecurityManager
...

@hohwille
Copy link
Member

ideasy -Dhttp.proxyHost=${https_proxy} intellij and IntelliJ was coming up.

Thanks for testing.
It seems that intellij is now working and this had nothing to do with the http.proxyHost property.
Since you were still getting the log message that you are offline, I conclude that the proxy problem could not be solved that easy.
However, I am also unsure if ${https_proxy} is set in your shell and gets resolved to a real hostname since otherwise this will not make any sense. Further if you have that variable defined it may be a full URL while Java only expects the hostname for that system property and you would need to specify another property for the port and specify everything manually as explained in the link to the Java documentation about proxy support I provided.

@hohwille
Copy link
Member

IMHO this bug is somehow related to this one:
devonfw/ide#1395

As it seems there is some problem on Windows with CMD using PATH entries in different format and git-bash using MINGW format and those two formats get mixed together causing garbage (see linked issue for details).

@sven-binnig
Copy link
Author

@hohwille
Strange: I have replayed my choreography from last week.
Neither the way described works today...
...nor hint about the system-properties https.proxyHost etc.

So - I will wait for the upcoming Beta-Release (or SNAPSHOT you advice me).

@hohwille hohwille linked a pull request Dec 5, 2024 that will close this issue
@hohwille
Copy link
Member

hohwille commented Dec 9, 2024

So - I will wait for the upcoming Beta-Release (or SNAPSHOT you advice me).

You are more than welcome to test the latest SNAPSHOT and let us know if the bug is fixed or still present.
I have changed the code some time ago:
Now, we first invoke git. Only if that fails and the git operation is mandatory, we throw an error.
There we check if the user is online or offline to produce a more helpful error message, in case the user is currently offline.
For the offline check itself when you are behind a proxy we already have #774.
Therefore I am closing this issue. Feel free to comment and reopen in case you can still reproduce this error.

@hohwille hohwille closed this as completed Dec 9, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in IDEasy board Dec 9, 2024
@hohwille hohwille linked a pull request Dec 9, 2024 that will close this issue
@sven-binnig
Copy link
Author

sven-binnig commented Dec 12, 2024

@hohwille
I have done following with version 2024.12.001-beta-12_11_02-SNAPSHOT

  • export environment variable HTTPS_PROXY
  • export environment variable IDE_OPTIONS
  • export environment variable GIT_SSL_NO_VERIFY

Creation of a new project with ide create test-project-1 works without issues.

Afterward I have installed intellij in the createtd project with ide intellij

  • cloning the urls of the tools works fine
  • downloading the zip of the tool java with version 21.0.5_11 didn't work, because I am offline.
Step 'ide (intellij)' failed: com.devonfw.tools.ide.cli.CliOfflineException: Not able to download tool java in edition java with version 21.0.5_11 because we are offline
 Step 'Install java (21*)' failed: com.devonfw.tools.ide.cli.CliOfflineException: Not able to download tool java in edition java with version 21.0.5_11 because we are offline
2 step(s) failed out of 3 steps.
Not able to download tool java in edition java with version 21.0.5_11 because we are offline

Error: IDEasy failed with exit code 23

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.

2 participants