Intellij IDEA can not find tools.jar - java

I install Intellij IDEA 15.0.2 on Windows 8.1, run it, it asked for the path to jdk, i choose directory with JDK, and then IDEA worked correctly. But after reload of PC, I get this error message from IDEA - 'tools.jar' seems to be not in IDEA classpath..So, I check JAVA_HOME from command line, check for tools.jar in JDK_directory/lib, everything is on their places, how to run IDEA?

Open IDEA. Select [File]-[Invalidate Caches/Restart] menu and select "Invalidate and Restart" button. Have a try. :-)

I think you didn't set up JAVA_HOME. Try to add JAVA_HOME=</path/to/JDK> variable to your PATH. For example JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66

A few years later, this still persists. I had this issue with java 16 and IntelliJ has it logged here as well. I tried a bunch of things including invalidating the cache and restarting. No luck.
Try Updating IntelliJ as they suggest in the linked website. That did the trick for me. FWIW, I was on IntelliJ IDEA 2020.1 and updated to 2021.2.

By deafault, idea.exe runs, but if you run instead idea64.exe, everything works correctly.

Related

IntelliJ problem setup JDK (compiles properly but keep seeing errors)

I have a problem with my IntelliJ : it is able to launch my project and make it work properly (because the JDK is set up correctly), but the view of my project is full of errors, like if it did not know the JDK, and it keeps asking me to set up the JDK. Here are some screens :
screen
I tried to invalidate caches and restart, but it did not change anything. I repeat, I can successfully launch this project, this is just about the view. This is really bothersome, could someone help me please ?
Thank you in advance,
Virgile Petermannn
Try this. first, clear your local cache files and then download dependencies.
rm -rf $HOME/.gradle/caches/
./gradlew build --refresh-dependencies
Remove JDK configuration in IntelliJ IDEA, reinstall JDK, add JDK configuration again in Settings (Preferences) | Project structure | SDKs.

IntelliJ is running old class files

I am using Intellij for my project development(Java). Strangely, whenever I try to run the project making some new changes to it, Intellij is always running old class files which were complied for a older version of my project. I tried recompiling, rebuilding, tried invalidate caches and restart, removed the project and opened it again but nothing seems to work. Not able to figure out the reason and now I am clueless what to do.
Any help would be appreciated. Thank you.
I've had the same issue and I haven't been able to consistently make it go away, however, here's some things I've tried that could help:
delete .class files
invalidate caches and restart
check settings: sdk and source path imports of IDEA code might affect it
delete and reinstall intellij
Or do what I've ultimately done, which is to create a new project and avoid spending 5 hours tinkering with IntelliJ to get it to run my code properly.
Follow these steps to let IntelliJ "forget" all old internal files:
Close the running IntelliJ instance.
Delete the .idea directory of your project.
Open the project like a new project.
After that you have a fresh IntelliJ project that probably needs some configuration (as usual).
I had such a problem in IntelliJ by a maven enabled project.
Running maven clean phase and ... , but no effect,
any change to classes had no effect in deployed project.
finally I found the problem.
classes was hidden in this path:
{Project Path}\src\main\webapp\WEB-INF\classes{my packages}
by removing this, problems has gone.
Hope it was useful.
In my case it was the maven issue within Intellij settings. When I used bundled version it gave the error it should have. I don't know why giving actual path won't work but Bundled Version will work.
In the context of Java Parser, I needed to run mvn clean install -DskipTests after each change on the command line. Then, class changes were available in IntelliJ. No other way helped here.

The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid

Ok im wondering where does xamarin get this path from?
Severity Code Description Project File Line Source Suppression State
Error The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid.
So I can go and change it to the new jdk1.8. I have the new JDK set up I just need to know where to change the path at.
I had the same problem and solution is.
Remove all jdk and install jdk 1.8
Change reference java location in Visual Studio Tool > Options > Xamarin
Clean and Rebuild Project
I've just solved this exact problem for me.
I don't know why you wouldn't have a JDK_HOME variable. Completely remove the JDK and install it again maybe?
The Environment Variables for java were set to my previously installed path. I guess Oracle screwed up here.
As I had the same error, here's what I did:
I went to C:\Program Files\Java\ and checked what the jdk folder is called. For me it's jdk1.8.0_102.
For users who don't know where to find System Variables:
Go to System Properties and on the left hand side, click Advanced System Settings. Switch to the Advanced tab, click Environment Variables. Under System Variables there should be two variables in the list called JAVA_HOME and JDK_HOME.
I edited those values and change the path to what I found in the java folder. In my case this would be C:\Program Files\Java\jdk1.8.0_102.
No need to close VS, just build your app and it should get passed the annoying error.
Hope this helps :)
I had exactly the same problem. I got it to go away (which is not the same thing as fixing it).
Un-install every bit of JAVA you have. Delete both JAVA folders (Program Files and Program Files (x86)).
Install the latest version of the Java (x32) SDK.
Clean and Rebuild your project(s).
Since my Solution is multi-platform, I changed the Startup Project to the .iOS one, built it, ran it in an emulator, and set the Startup Project back to the .Droid project.
Somewhere in all this, the problem went away.
And remember kids! If it can go away all by itself, it can come back again all by itself!
I had this issue as well, I downloaded 32 bit Java but VS was still looking for the 64 bit one.
To solve it all I had to do was change the JAVA_HOME and the variable in my Path, clean my project and rebuild it.
Just set JAVA_HOME and JDK_HOME ambient variables, clean your solution and build again. For me worked fine.
Don't forget to clean your solution.

Intellij Error: Internal caches are corrupted or have outdated format

I am getting an error intermittently when I build my Java project in Intellij.
Internal caches are corrupted or have outdated format, forcing project rebuild: java.io.FileNotFoundException: C:\target\classes\ehcache.xml (Access is denied)
I have run File->Invalidate caches. I have restarted Intellij and killed all Java processes. I eventually get it to build again but not sure what thing I try does the trick.
When I try to access the 'Target' folder, it says Access Denied.
Anyone seen this before?
As mentioned in my comment, I received the same message, but without any access right issues involved whatsoever.
It seemed to be some kind of confusion on IDEA's end. I was able to fix this by deleting the system directory in C:\Users\%USERNAME%\.IdeaIC13 (the path obviously depends on the IntelliJ IDEA version).
This stores all caches and indices among other things. I have to confess that I can't tell why exactly this helps, but it seems to be a rougher way to "invalidate caches" and it works. Your project history is not deleted this way, so you can practically continue working - just that all files have to be scanned again and all indices have to be rebuilt.
In any event, this was not an access rights problem at all.
For me, I just had to clean all modules (and ensure they didn't require sudo permission), and rebuild.
The File->Invalidate Caches/Restart... did not work for me.
If you can't access the folder have to either change the rights for the entire hierarchy starting from your project root folder as described here, or move your project to some other directory that you are allowed to access
Tried all the above, but none worked for me. Finally running Intellij 14 in admin mode did the trick.
I had this exact problem, I tried all of the above solutions but none of them worked for me.
The I tried the oldest one in the book (ie rebooting my laptop) and that fixed everything!
Similar to pdinklag's answer, I had to delete my user-level Android Studio caches to get rid of this error. However, Android Studio caches are stored in ~/.android/.
I shut down Android Studio, then ran:
cd
rm .android/cache build-cache build-cache.lock
Then restarted Android Studio, and things worked.
I had the same problem in Intellij 17 version for Mac.
Rebuilding the project, changing the directory of the project, cleaning the module, and running IntelliJ 17 with admin mode did not work.
Updating Intellij to 2019 version solved the error. It seems the application was not able to get the admin permissions.

Java won't work (Possibly related to installing QTP)

I was working on eclipse two days ago, and closed it properly.
Now, when I'm trying to start it, I get the splash screen popping for a blink of an eye, then disappearing.
I get:
no error message, and
no error is logged in the <workspace>\.metadata\.log file (the last errors logged there are from two days ago).
Apparently, the problem isn't with the workspace, because I changed the SHOW_WORKSPACE_SELECTION_DIALOG argument in <eclipse>\configurations\.settings\org.eclipse.ui.ide.prefs to true, and it doesn't even get as far as showing the dialog.
There's only one thing I can recall I did before it stopped working - I have installed a plugin for UFT Java Extensibility SDK from HP.
Needless to say uninstalling it didn't help.
Is there any other log I can hope to find helpful?
Or anything else I can do to get it to work?
EDIT:
I was just trying to start another instance of eclipse I have (adt-bundle-windows-x86-20130219), and got the same outcome.
EDIT:
I added Java & QTP to the title in order to help others who bumps into the same issue.
If the JRE is somehow the issue, try installing a JDK (not a JRE), in a non-default path (for instance, C:\Prog\Java\JDK1.7.0_xx), and make sure your eclipse.ini explicitly reference that JDK.
-vm
C:/Prog/Java/jdk1.7.0_21/jre/bin/server/jvm.dll
(you can use '/' even on Windows in an eclipse.ini file)
The problem was indeed with Java (Thanks Arne). Re-installing the jre didn't help, so I also tried to deleted the JAVA_OPTIONS and JAVA_TOOL_OPTIONS enviroment variables, which solved the problem.
Later, I found this discussion which seems related to my problem: http://h30499.www3.hp.com/t5/Unified-Functional-Testing/Environment-variables-JAVA-OPTIONS-and-JAVA-TOOL-OPTIONS-is/td-p/5855995.
I will look more deeply into it later, when I will start using HP's plugin, but I hope this thread can help others who run into trouble with eclipse after installing this plugin.

Categories

Resources