java.io.FileNotFoundException for .cache file in IntelliJ - intellij-idea

My project is IntelliJ was all fine and suddenly I started getting the following error
Loading project definition from C:\Users\Manu\Documents\manu\codingjedi\code_related\code\frontend\web\project
java.io.FileNotFoundException: C:\Users\Manu\Documents\manu\codingjedi\code_related\code\frontend\web\project\target\config-classes\$999b06365add2ae5fadc.cache (The system cannot find the file specified)
I am unable to compile my code due to this. What is the issue?

worked after removing (by renaming) the project/target directory and rebuilt the project. It created a new target directory in project and things are working again

Whenever you have caching issues in IntelliJ, you can try to use the Invalidate Caches / Restart action in the File menu. Please read the displayed messages carefully ("WARNING: Local History will be also cleared.").
Another thing you could try: Rebuild Project in the Build menu.

Related

Could not create parent directory for lock file C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\

I'm relatively new to IntelliJ. I'm using IntelliJ IDEA 2019.2.4.
When I try to do an Import From Existing Source - I get the following error:
Could not create parent directory for lock file C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\jbr\bin\proxy\wrapper\dists\gradle-5.3-all\b2xqo51qjs5t4spu8wb5tlf15\gradle-5.3-all.zip.lck
That's new - I didn't used to get that.
Any suggestions?
Thanks much
This issue has been discussed by another already (in Android Studio) but I will quickly summarize the issue as it should be quite similar using IntelliJ. Thanks to Mike Hill this will remedy your problem. Here is his answer Could not create parent directory for lock file
The issue you discussed appears to have been caused by using the "Use gradle 'wrapper' task configuration" option in IntelliJ..this option causes IntelliJ to override the Gradle wrapper task (which is sort of expected).
The solution that Mike Hill suggests is to select "Use default gradle wrapper (recommended)" instead. Seems that this caused a conflict with the customized GRADLE_USER_HOME environment variable in IntelliJ for the directory where the final wrapper files actually get stored.
He then provides an absolute path example which may be what is throwing the error for you as well.
Gradle was trying (and failing) to create C:\ProgramData\chocolatey\lib\gradle\tools\gradle-4.5.1\wrapper\dists\gradle-4.5.1-all\87kuriyahurjjkki3zii366f2\gradle-4.5.1-all.zip.lck when run through IntelliJ, although his system uses the file C:\work.gradle\wrapper\dists\gradle-4.5.1-all\87kuriyahurjjkki3zii366f2\gradle-4.5.1-all.zip.lck when working correctly.
Switching and then running the Gradle refresh through IntelliJ seems to have fixed it for Mike. It also succeeds when switching back to "Use gradle 'wrapper' task configuration", now. Hopefully this helps you out Tim!
I did hours of research and I discovered that the localhost:8080 on my program had never fully detached last time I stopped running the program. The program refused to start because really it never stopped from last time. Detach you localhost. If you don't know how just restart the computer--it will detach everything
Encountered on Mac.
Seems like a bug in IntelliJ IDEA.
Changing Gradle user home from ~/.gradle
to an absolute path /Users/username/.gradle has actually helped

IntelliJ 2017.1.4 - Refusing to open terminal window

I recently downloaded the latest version of IntelliJ Ultimate (at this time, it is 2017.1.4) for work.
For some reason, I cannot get it to open a new terminal window. When clicking the plus button here:
...nothing happens. Additionally, nothing shows up in the event log. I restarted IntelliJ, my computer, and did the "invalidate caches and restart" option.
Any ideas? Is there a log file I can look at?
It could be a known issue that is already fixed in 2017.2.
Another possible case is that the native terminal library fails to initialize on your system (check idea.log for exceptions). This can be caused by an antivirus or a corrupted IDE installation.
Thanks to #CrazyCoder for reminding me to check idea.log - the native terminal library, as well as other plugins, failed to initialize.
The root cause of the issue is that at my workplace, there is a security restriction to not run any executable that exists outside of C:\Program Files. As a result, IntelliJ cannot run certain plugins, jars, etc. that exist outside of that location, because it will attempt to execute them from your user directory.
To fix this, in IntelliJ, go to Help > Edit Custom Properties and point the config and system path to a known path where you can run executables, like so:
# custom IntelliJ IDEA properties
idea.config.path=C:\\Program Files\\JetBrains\\.IntelliJIdea2017.2\\config
idea.system.path=C:\\Program Files\\JetBrains\\.IntelliJIdea2017.2\\system
You will need to make sure to copy the contents of both directories to the new location. Hopefully this helps anyone else who runs into this issue.

compiling golang using intellij is looking for wrong path of 3rd party packages

I'm using IntelliJ with the go plugin to write my application.
version of Go: go version go1.7beta2 darwin/amd64
Operation system: OSX El Capitan 10.11.5
Intellij Version: 2016.1.3
Go Installation Location: /usr/local/go
Go Pkg Location ($GOPATH): /Users/ufk/projects/go
when I open terminal, browse to my application's main source file, and type go it compiles it properly without any errors.
but when I try to Run the program using Intellij, which also compiles it, i get the following error:
/usr/local/go/pkg/tool/darwin_amd64/link: cannot open file /usr/local/go/pkg/darwin_amd64/github.com/codegangsta/negroni.a: open /usr/local/go/pkg/darwin_amd64/github.com/codegangsta/negroni.a: no such file or directory
lookgs like it's looking for the negroni package in the location when I have go installed, and not where I the 3rd party packages are installed according to $GOPATH. My project is configured to use $GOPATH, and the real time error of the intellj editor doesn't complain about packages that are not installed which means that Intellij does check the $GOPATH variable.
so what am i missing ?
thanks
update
Hi :)
I noticed something new... I have 2 go projects, one of them is the JSON Api Server, and the other is for the web server.
The project that is causing issues is the Api Server.
now, the web server also uses and imports negroni, but the problem occurs only on the Api Server Project.
so I decided to go wild and delete the .idea and iml file from the Api Server, reopen it with intellij, and see what happens... welp, what happens is that now it complains about a different module.
/usr/local/go/pkg/tool/darwin_amd64/link: cannot open file /usr/local/go/pkg/darwin_amd64/github.com/jingweno/negroni-gorelic.a: open /usr/local/go/pkg/darwin_amd64/github.com/jingweno/negroni-gorelic.a: no such file or directory
the thing is.. that my web server project also uses negroni-gorelic and things are fine!
I tried downgrading go from 1.7beta2 to 1.6.2, deleting the content of the modules ($GOPATH/pkg and in src directory github.com and golang.org)
then I got all the modules again.. tried to compile with intellij and the results are the same.
so... hope this helps to further investigate the issue.

Intellij IDEA - JavaFX packager : access denied

I'm trying to generate an artifact of my JavaFX application using Intellij but for some reason I always end up having JavaFX packager throwing an access denied error on my output directory.
Generating a simple jar works fine though.
I'm using it on Windows 8.1 with Java 8.
I had the same problem. I kind of solved it:
by ticking the "Build on make" box in the Project Structur Dialog
starting a Run of my Java App in Intellij Idea
Now the executable jar magically appeared in my build folder. God knows why.
I had this problem and solved it by deleting the Artifact from IntellIJ, then deleting the "out/artifact" previously created folder where it tried to build my jar and finally re created an artifact from scratch. For no specific reason it now worked.
I have encountered the same problem recently. I checked the permissions of the directory and can read and write. Later I deleted the artifact and re-created a new one to solve the problem. I hope to help people who have encountered this problem.
I had this problem. I ran into it because When I added artifact with + button in Project Settings->Artifacts, I selected JAR artifact , and change JAR to JavaFx Application from type drop down box on right side pane. Later, I removed this artifact and pressed + button, then selected JavaFx Application from drop down list, then it was builded successfully. My JDK version is 8.
When I call JavaVXPacker from the command line I get the following:
C:\Users\Ingo>javafxpackager -help
javafxpackager.exe has been renamed javapackager.exe.
The original file may be removed in a future release in lieu of javapackager.
Please update your scripts.
...
...
So I guess IntelliJ has to update it's script to re-enable the feature???
(using Windows 10 and JDK Liberica 15+36)
Go to File > Project Structure
Click on Artifacts on the left panel.
Thereafter click on the plus icon to add a Jar From modules with dependencies…
A pop-up will be shown and there you would have to select for the startup class of your project.
Click on OK twice to save the changes.
Lastly go to Build > Build Artifacts... And select build action.
Now your jar will be generated in the out folder of your project.
For a more details guide, please refer to this post

Intellij IDEA ignoring files run issue

Hello all I am trying to run a programme using Intellij. The programme runs perfectly in Eclipse and Terminal. However using IDEA it seems to ignore 2 files.
java.io.FileNotFoundException: .\data\def\items\ItemValues.txt (The system cannot find the path specified)
There are no errors normally in Intellij. I just get this error upon running it. The file is there I have checked and path is correct. Intellij just seems to be ignoring it.
Check Working directory in Run/Debug Configuration, you need to change it to $MODULE_DIR$ if you have multiple levels of maven modules.