No such file or directory error on Intellij IDEA Ultimate for apple sillicon
Answered
I've got new macbook pro M1 couple of days ago.
I am trying to start some Java project inside Intellij Ultimate and got error `no such file or directory` but files in question exists, and I use the completely the same setup on older imac that I used until now.
I tried switching directories, opening on different path, nothing works.
I am starting project through gradle, and trying to run gradle taks. I've also tried switching gradle bin, from project bundled to default in intellij, installed on system - doesn't work.
Is there something specific to new IDE versions for apple sillicon to be checked or changed?
Please sign in to leave a comment.
Does https://youtrack.jetbrains.com/issue/IDEA-261179, look like your case?
Please attach a screenshot showing the problem and collect diagnostic data for future investigation. (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files)
The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)
It works with different JDK, but it should be the same I think.
I installed adoptopenjdk with homebrew and ran with that, didn't work. Not just for try purposes I downloaded openjdk archive from openjdk.net and tried with that and it worked. Shouldn't those be the same?
Thanks, anyway.
We do not recommend using custom JRE for running the IDE process. Please try switching to JBR (JetBrains Runtime) as per https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under .
I am not sure we are talking about the same thing. Maybe I do not understand you well. I didn't change IDE process runtime, I didn't even chagnt those.
I just ran gradle task with custom JDK (openjdk) mentioned before.
Got it, thanks. Can you please attach a screenshot showing the problem and Gradle settings and collect diagnostic data? (Help | Collect Logs and Diagnostic Data)
OK, I've uploade screenshots and diagnostic data.
Upload id: 2021_02_10_JyQEkLkbGr86jYp8 (files: idea-logs-20210210-163038.zip and 4 more)
Just an update now it fails even with JDK from path it worked yesterday. Without any error displayed, just exits unsuccessfully.
The cause is
Notice the
What logic do you have there in the build script?
I assume it also fails if you build it from command line by Gradle (provided that the same JDK is used)?
>It works with different JDK, but it should be the same I think.
Does it work if you switch to another JDK? With what JDK does it work? Attach screenshot of the JDK that fails, selected in Project Structure | SDKs settings page.
That line is only loading properties file:
applicationProps.load(new FileInputStream('src/main/resources/application.properties'))However the file is present and everything is ok. On my linux machine and older iMac it works without issues.
JDK in question is adoptopenjdk12 installed from homebrew.
What is the output from ./gradlew clean build from terminal?
Looks like the current working directory of a Gradle daemon is not set to a project root directory. See https://github.com/gradle/gradle/issues/5991#issuecomment-405499837 on the recommended way of using relative paths in Gradle build scripts.
The same setup works on Linux machine, and on older iMac. We are using project bundled gradle, that is why I do not know what is different.
What result do you get when building in terminal, have you tried it?
The behaviour may depend on the JDK used by Gradle (Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM). This is also noted in mentioned thread.
The same happens from terminal. Yes I first checked the gradle settings, and it is using the JDK I want.
Gradle has different treatment of the current working directory for different JDKs and project types. You need to refactor your build scripts to work properly with relative paths, see a note in the Gradle's documentation:
>Never use
new File(relative path)because this creates a path relative to the current working directory (CWD). Gradle can make no guarantees about the location of the CWD, which means builds that rely on it may break at any time.Check the Gradle's documentation on proper path usage in build scripts, and see the Project.getRootDir() method.
Hi please I need help i have download java on my mac and i'm trying to run
nano~/.bash_profile but i'm getting
No such file or directory
Juiceking400
See if the following articles help: