Compilation Error not displaying in Eclipse - java

I am using Mac Yosemite and Eclipse Luna.
I have successfully imported Maven projects into my workspace and the projects were running without any errors. The issue is Eclipse is not showing compilation error in editor or in project explorer.
Default Builders is "Maven Project Builder".

Right click a project in the project explorer and choose Maven > Update project, or press
Alt + F5. Select all the relevant projects and Ok. This automatically cleans and updates the workspace.

Right click on your project and go to Properties.
Goto Java Build Path and then select Source tab.
In this Tab there should be an entry with yourProjectName/src .
Expand this and in the Excluded-property, remove everything, i.e., it should
not exclude anything.
Remove any other entries in Source tab only yourProjectName/src should reside.
After this you may see errors in your project in package explorer.
Expand src folder and remove the package that is showing the error.
It helped me this way.

Related

Eclipse editor not showing error markers

My eclipse is not showing error in its file editor. I have tried cleaning and putting project on Build Automatically. However when I run it then I do see the compiler error in console and also in problem view just after saving the file. Does anyone have any idea how to fix this ?
This is the version of my eclipse:
Eclipse IDE for Java Developers Version: Neon.2 Release (4.6.2)
Adding more images:
Check the Build Path of the project by right clicking the project and select Build Path -> Configure Build Path.
JDK is not properly configure for project. Configure your JDK instead of in-build JRE.
Also make sure your source folder is also configure in Build Path (for example MyProject/src) must listed as a Source folder.
In Java Compiler-->Errors/warning, click Restore Default.
Make sure "Build Automatically" is checked.

Error running: Project has no JDK configured in IntelliJ IDEA Ultimate

When I try to execute program ergo, it gives me an error.
Error running: Project has no JDK configured
Can anybody help me? I'm newbie in IntelliJ IDEA.
1) Open Project Structure present under File menu or use shortcut ctrl+alt+shift+S
2) SDKs is located under Platform Settings. Select it and click the green + up the top of the window.
3) Set JDK home directory path (e.g.: /usr/lib/jvm/java-1.8.0-openjdk-amd64) and click on Apply and OK.
You should be able to execute your program now.
First, close IDE and follow this step:
1. You can delete these folders in the project structure:
.gradle
.idea
build
2. Then open IDE and reimport the project.
Hopefully resolved !!
open File -> Project Structure, under project SDK, where it says no JDK select dropdown and check if they are any JDKs available, select available JDK then click Apply then OK, your project should run now.

java eclipse red exclamation mark

I have just got a new computer and installed Eclipse Indigo and all of the plugins that I use. But when I open my workspace from my old computer some projects have an exclamation mark.
What does a red exclamation mark mean on a project folder?
The red exclamation mark usually means there is a problem with the Build Path.
Do you see any alerts in the "Problem" View?
It means that there is an error on that project..
You can look at all the errors in the Problems tab. press ALT SHIFT Q followed by X to
show this tab.
It means that there are two things happened.........
What ever jar file or project setup jar file for your application
are not located at that point where it was earlier in your computer.
So that First you have to setup your project with all the jar files
and refresh it.
Check syntax in your project might be some mistake in that.
The red exclamation mark in eclipse is because of the problem/issue with the build path.
To find the specific issue look at the problems tab of the eclipse.
Window -> Show View -> Problems (or) Alt+Shift+Q,X
If you didn't find any error on the project files, usually it means your build path has some issue. First Check your jar file and jar file locations.
On eclispe, right click on your project, Go to build path and go to Configure build path. Check any errors under libraries. Configure it correctly and refresh the project.
It appears mostly because of "build path" only. But just in case you are working on a MAVEN project, here is the solution.
Solution
Step 1. Expand your project in Eclipse > Right click on "JRE System Library" > "Build Path" > "Remove From Build path"
Step 2. Expand your project in Eclipse > Right click on "Maven Dependencies" > "Build Path" > "Remove From Build path"
Step 3. Reach out to your local repository and follow below path "C:\Users\userName\.m2\repository" and delete everything inside repository folder
Step 4. Refresh your project in Eclipse
Step 5. Right Click on your project > "Maven" > "Update Project"
Step 6. Just refresh your project and now we are Ready to GO..
In my case show hidden files was enabled and i had added hidden jar file extensions along with the original jars. Adding only the jar files except the hidden files solved the problem
It can appear when any other file other than .jar is added in the jar library. To fix this, remove the file and clean the project.
If it is maven project and your project view having no error. Then try the following steps
Right click the project ---> maven --> update maven
It works for me.
What the error means is that the Java (JDK) version installed needs an update, as the older version could not be read. To rectify the issue, uninstall your Java (JDK) and install the latest version. Restart eclipse and the would be seen resolved.
This may help in case your build path is correct and you have put the right signature and access specifier for main, so maybe used as a hook to try before you make any modifications to your build path.
Just go to your problems bar and delete the problem given for the project, clean the project and build it. It should solve the problem, if these steps cause the red exclamation to go away.

Maven 2 project error icon in Eclipse

I have create multi-module maven project in Eclipse IDE (already installed M2Eclipse plugin). There I can build my project successfully. But after build also it shows errors icon in my every module project. What kind of issue it can be?
Thank You.
Without knowing what errors you are seeing I am going to assume that your issue is with eclipse project properties (build path, src directory specification, output classes directory, etc).
You tagged m2eclipse plugin, so you should be able to right click on your project in eclipse select maven->update project configuration. If you do not see that option under maven then you should first see an option called maven->enable dependency management. Click that first and then you should be able to see update project configuration option.
If this does not fix it, then open your project directory containing the pom.xml file in command prompt and run mvn eclipse:eclipse.
One of the above should resolve those pesky error messages provided that your maven build itself is successful.
In eclipse open the Markers Tab (You can open it from Window -> Show View -> searching Markers)
It will show all the related errors with your project. You can identify your problems related to your problem, and solve accordingly. Sometimes it shows Quick Fix option, which is helpful.
For me, the above solution listed out by #CoolBeans was not working out, so i searched further and found out the following:
Go to Problems windows(present besides of Console window). If it is not there then click on Window-> Show View -> Problems
Inside Problems you will be able to see the Errors Description related to your project. In my case it was "java compiler level does not match the version of the installed java project facet". If that is the case for you as well, just follow below steps:
Right Click Project -> Properties
Click Project Facets(present in the left hand side list)
Choose the correct java version in Java Project Facet
Click Apply
That's it!

Eclipse shows errors but I can't find them

I am trying to run my project, but Eclipse is saying I have errors. But there are no errors, just a red cross where the project name is. I have tried deleting the R.java and generating a new one, but that didn't work.
Take a look at
Window → Show View → Problems
or
Window → Show View → Error Log
Based on the error you showed ('footballforum' is missing required Java project: 'ApiDemos'), I would check your build path. Right-click the footballforum project and choose Build Path > Configure Build Path. Make sure ApiDemos is on the projects tab of the build path options.
This happens from time to time in Eclipse. In the "Project" menu there's a "Clean" option, that usually takes care of the problem.
Go to project>clean and select the project which display error from check box and click ok , it will clear the error for you.
Click the tab which display build automatically in the project menu
And if this also does not work than restart the eclipse and try again it will work.
For me, this happens with Maven and Eclipse/STS whenever I update my IDE or import an existing Maven project. Go to the "Problems tab" (Window -> Show View -> Problems) and see what it says. Recently, the problems tab showed Project configuration is not up-to-date ... and suggested that I use Maven to update my project configuration, and this solved the "red X" problem. To do this, in the "Project Explorer" view, trigger the context menu and select Maven -> Update Project, as seen in this screenshot:
If you see the error in problem panel it will say : Description Resource Path Location Type
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
Solution : Right click on project > select : Maven->Update Project
Error gone.
Right Click on Project -> Build Path -> Configure Build Path. Check if Maven Dependencies is there in list, if not then update maven project by
Right Click on Project -> Maven -> Update Project
I had a red X on a folder, but not on any of the files inside it. The only thing that fixed it was clicking and dragging some of the files from the problem folder into another folder, and then performing Maven -> Update Project. I could then drag the files back without the red X returning.
Ensure you have Project | Build Automatically flagged. I ran into this issue too and turning that on fixed the problem.
I just removed all the private libraries in JavaBuildPath and added the jars again.. It worked
I came across the same issue while working on a selenium project(maven). The Project folder and pom.xml were showing red cross symbol. This was coming as i had the test datasheet open. I could remove the error by just closing the datasheet and the never faced the issue again
In my Spring Boot application, I right-clicked on my Application class -> run as -> Java Application -> Proceed(All errors will be cleared)

Categories