I have a couple of dependent java projects.
The problem is even though the build fails and the files contain obvious compile time errors, Intellij does not give any suggestions about the files that contain compilation errors.
In eclipse, it is too easy. You see the compilation errors right away.
I explored the problems tab, but honestly I don't find it helpful. It only tells that the project has some errors, that is it.
Seriously thinking about switching back to Eclipse if Intellij does not have such a basic feature.
Related
I have a multi-project gradle setup (settings.gradle) which I import to eclipse using OpenJDK-12.
After importing I get compile errors (on some but not all projects) like this:
The type javax.xml.parsers.DocumentBuilder is not accessible
If I clean (and automatically rebuild) the project, the error goes away. If however I clean all projects, errors reappear (not necessarily the exact same errors, but all of them are of the "... not accessible" kind.
This seems like an eclipse bug to me, but if anyone has an idea what I can do to further narrow down the problem I'd be thankful.
It is possible to run a project, which contains errors in Eclipse.
I think it is normal for project with many files to contain some erroneous files to fix in the future and still be able to run it.
Unfortunately, I can't find this possibility in IntelliJ.
Methods proposed in this answer IntelliJ Idea, run code regardless of errors in unrelated project files do not work for me.
It throws ClassNotFoundException in the class with main. Class itself contains no errors and was running under Eclipse. There is no apparent appropriate *.class file in target/classes directory.
In your run configuration, you can tell it not to make before running.
You can compile individual files through their right-click menu or (from memory) Ctrl+Shift+F9 if the file you want to compile is in the editor.
A combination of these two will mostly achieve what you want, although this is probably the key paradigm difference between IntelliJ and Eclipse, and you'd be using IntelliJ in a sort of non-IntellliJ way (if you see what I mean).
Very often, it is the case that there is a compilation error in a project, yet I can't really find the source of the error.
For instance:
This web project has an error, yet it's basically my guess as to what the error is. Why isn't there a way to right-click an option called "find source of compilation error"? There's no quick fix option available.
This is a simple question. I don't understand why this is an issue, because Eclipse knows what the problem is, but why won't Eclipse tell me?
Press CTRL + 3 then type Problems and hit Enter. This should show a list of all the issues in the project.
I am suddenly getting this error from eclipse when compiling.
Internal compiler error: java.lang.NullPointerException at
org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor.visit(AnnotationDiscoveryVisitor.java:61)
The project is an android project. Any clues? Don't want to do another eclipse reinstall! Help!
Little late, but I had the same problem and also tried to find solution. Maybe it will help someone in the future:
The problem is that Eclipce is unable to compile files and it throws an exception. In my case the fix was:
Move for now all compiled sources (buildBin folders)
Move for now all custom builders (.externalToolBuilders) if you have ones, and all .settings folder
Restart Eclipse and let it build
Fix compilation problems :)
Paste back all previously removed files (to not loose any settings\builders)
I'm using Intellij IDEA for work on a Java project.
I'm finding I get a lot of false positives when I build in Intellij, but only when there are other compilation errors - e.g. I've made a change and expect a number of compile errors, so I build to find all the errors. (In this instance, I changed a widely used interface, and want the compiler to catch the errors so that I know which implementations to fix.) In addition to some of these expected errors, Intellij reports hundreds of false positives (which makes it difficult to find the real errors - at present the compiler is showing only one genuine compile error each time, so I have to rebuild to find the next error...). These false compile errors are not highlighted - indeed, they are not real compile errors. (Nor do they appear if I compile via Maven.)
The most common error is 'cannot find symbol class [X]', despite that class often being in the same project.
I've tried:
- upgrading Intellij (from 10.5.1 to 10.5.2 to 11.0.1)
- invalidating and rebuilding caches
- restarting Intellij
...but all to no effect.
I've searched the Intellij Bug Tracking board, but haven't found any reference to this there, so wondered whether this is user error (if so, what settings do I need to change)?
Has anyone else experienced anything like this? If so, how did you fix it?
This is probably too late to help you, but maybe it will help somebody else. I had a similar problem. IntelliJ complained that it couldn't find a symbol class, and the class it couldn't find had an icon with a little x in the upper left hand corner. The x indicates that the class was excluded from compilation. (I have no idea how that happened.)
To include the excluded file, access project settings, e.g., by clicking Ctrl+Alt+S. Then you can modify the list found under Project Settings -> Compiler -> Excludes, to re-include the excluded file.
Such issue can be caused by incorrect project configuration, like when some module source directories are added to the dependencies as library roots. If you can't find a problem yourself, either contact support or file a bug to YouTrack with a sample project attached and the steps to reproduce the problem.