Intellij IDEA ignoring files run issue - intellij-idea

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.

Related

java.io.FileNotFoundException for .cache file in IntelliJ

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.

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.

any way to run intellij community build from altered source?

I made changes to Intellij Community Edition (ce). I can compile and run those changes from within the IntelliJ editor. That launches a second instance of IntelliJ ce which is running from classes containing my changes. What I want to do is just run those changes without having to first load the source, compile and run from within IntelliJ.
Netbeans made this easy by just producing an executable as a result of the build. With Intellij, it's not at all clear what has to be done. I have tried the following-
using the Run configuration Intellij itself uses to run the altered classes- this includes setting the working directory , main class, vm options and classpath. Actually, this doesn't work for reasons unknown to me.
on someone's suggestion, running dist.gant in build. This blows up with very many errors which are not helpful (no class def found errors which indicate some confusion on Intellij's part on classpaths somewhere)
Running WinLauncher.exe under bin gives the error message that it can't find VM options file (although it's in bin, (and also for good measure under bin/win with the other files which are co-located with vmoptions in the intellij directory structure for Intellij proper. )
ALl this is just harder than it should be. The solution is to provide an executable as a result of the build and place it in a predictable location.
Has anyone ever actually DONE what I am trying to do- make changes to the community source then use the resultant editor not as a project you're working with in IntelliJ but as the Intellij editor you're working through?
FOLLOW UP
User60561 had the correct answer. Just to mop up the details, in artifacts, there is a compressed file (win.zip for Windows, mac.zip for Mac etc.). In order to run your snapshot, you have to unzip this archive (after which it will have the same name, minus the zip extension) then go into folder "bin". There you'll see two executables: idea.exe and idea64.exe, for 32 and 64 bit versions, respectively. Clicking on these runs your snapshot.
Adjusting contents of the files idea.exe.vmoptions and idea64.exe.vmoptions lets you set the VM parameters to suit yourself, typically people might want to give the VM more memory through the -Xmx value.
It seems straightforward:
To build the distribution archive of IntelliJ IDEA Community Edition, execute build.xml Ant build script in the root directory of the source code. The results of the build execution can be found at out/artifacts.
https://github.com/JetBrains/intellij-community#building
So download ant, and run ant in the directory that you have it stored in. Make sure to use the commandline to launch ant in order to make sure everything is working correctly.
Initially execute getPlugins.bat/sh, then:
Use update.bat/sh according to it's instructions
Or
Click on: Main Menu | Build | IntelliJ IDEA CE build
Copy content of intellij-community\out\deploy (lib, plugins folder) into existing IJ installation (sometimes it is better to delete existing folders if they contain older dependencies or when the installation was of Ultimate version)

Importing gradle project in IntelliJ

I have IntelliJ 12.0 on and gradle 1.2. on Windows 7. When I try to import a build.gradle file I get the following error message in IntelliJ. I am a bit lost here. Any ideas on how to fix this?
(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.jetbrains.plugins.gradle.remote.GradleApiException:
Could not fetch model of type 'BasicIdeaProject' using Gradle installation 'C:\Program Files (x86)\gradle-1.2'.
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=c:\program files (x86)\jetbrains \intellij idea 12.0\jre\jre,daemonRegistryDir=C:\Users\Nilo\.gradle \daemon,pid=5144,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX: +HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
Actual: DefaultDaemonContext[uid=d8c5c4bc-5488-42c2-b4b3-28c1d53afacf,javaHome=C: \Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre,daemonRegistryDir=C:\Users\Nilo \.gradle\daemon,pid=6880,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
at org.jetbrains.plugins.gradle.remote.impl.GradleProjectResolverImpl.resolveProjectInfo(GradleProjectResolverImpl.java:61)
... 21 more
my fix: File -> Project Structure -> change the jdk path to not have jre.
I'm not sure how it got there, but it took me forever to track down. Perhaps because it picked up settings from a previous bad install.
Looks like it might be fixed in 12.1 or 12 EAP: IDEA-102365, IDEA-89697
Though I did not find the root cause where the different javaHomes have been taken from, at least I found a workaround that worked for me:
Try setting the following in your gradle.properties (either in %USERPROFILE%\.gradle\ or in your project build dir):
org.gradle.java.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre
IntelliJ v15.0.6, same problem.
I'm using a JRE that's not the one that is built into IntelliJ.
I made sure JAVA_HOME was pointing to my JRE, then
I deleted "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\", then
I restarted IntelliJ.
Now my gradle build scripts work fine from within IntelliJ.

intellij - java: Cannot find JDK '1.7' for module

I've just installed IntelliJ on Windows 8 (and 7). I then use the 'Java Hello World' Sample as my project.
I then selected the JDK that was installed (C:\Program Files\Java\jdk1.7.0_10). Project creates successfully and I can see all the classes associated with the project etc. When I "make the project" I get the following error:
Compilation completed with 1 error and 0 warnings in 2 sec
1 error
0 warnings
java: Cannot find JDK '1.7' for module 'TEST'
No matter what I do I cannot compile any Java code under Windows8/IntelliJ
I have tried the following:
Invalidating cache.
Switching to 32bit JDK instead of 64bit
Idea64.exe instead of idea.exe
Installing 1.6 incase it was a 1.7 issue??
Changed the JAVA_HOME to point to different versions (ie currently C:\Program Files\Java\jdk1.7.0_10)
I'm lost as to why this is happening.
project structure > project > choose correct jdk
or ctrl+alt+shift+s > project> choose correct jdk
also platform settings > SDK's >and make sure 1.7 is there.
Found the root of the problem. Turns out Windows 8 under parallels shares the same Desktop as OSX. This confused IntelliJ somehow and as a result it couldn't compile properly.
In parallels by removing the "Desktop" shared under Configure this then resolves the issue.
In case you want to still share the documents & desktop, the solution is to modify the idea.properties file (for instance, under C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\bin\idea.properties ), and change the following properties to point to different a location that is specific to the OS in which you are working:
idea.config.path=
idea.system.path=
idea.plugins.path=
idea.log.path=
I also copied the previous folder (on my computer it was under
\\psf\Home\.IntelliJIdea12
) to the new location to preserve all settings.
Update: I had the same problem after I installed IntelliJ Idea 13. I moved the .IntelliJIdea13 folder to c:\Users\costa from \\psf\Home, then I modified the C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.0\bin\idea.properties file:
idea.config.path=C:/Users/costa/.IntelliJIdea13/config
idea.system.path=C:/Users/costa/.IntelliJIdea13/system
idea.plugins.path=C:/Users/costa/.IntelliJIdea13/config/plugins
idea.log.path=C:/Users/costa/.IntelliJIdea13/system/log
I made the error while editing idea.properties to leave a whitespace at the end of my personally added idea.config.path=../.IdeaIC/config line.
This resulted exactly in the Cannot find JDK '...' for module error message.
I needed to "trim" the line manually, just deleted the whitespace, restarted IntelliJ and everything worked fine again.
I found this while scanning the idea.log file where I found java.io.FileNotFoundException: C:\Software\IntelliJ IDEA Community Edition 14.1.3\.IdeaIC\config \tasks\root.contexts.zip
In my case, Idea said "Failed to save settings" (probably due to a lot of projects being open. After that, it could not run tests with "Cannot find JDK '1.8' for module XXX" message. Idea restart solved the issue for me.
I believe this is an IntelliJ bug.
This isn't a fix, but you can work around this by going to Settings > Compiler, and disabling 'Use External Build'.
It seems that sometimes Intellij (or the user:-)) is getting confused when importing settings, especially if you change the paths where the jdk resides (for me it happened during a migration to a new Linux environment).
The only way I could correct this was to delete the user's settings folder.
In Linux :
I removed the folder (and subfolders): ~/.IntelliJIdea12/
Of course this would remove the saved settings, licenses e.t.c.