No Projects shown while trying to setup Debug configuration in Eclipse - java

I have installed Eclipse 2020-12 (4.18.0). And also imported 2 Gradle Java projects.
When I try to debug it, so for that I need to provide Debug configuration as we do in Eclipse.
I clicked on Debug Configuration-> Remote Java Application -> New Configuration->Connect.
But while doing that, there are no projects shown when I click on Browse Button.
How to solve this problem?
Also , when I open any java file , it shows 'J' symbol as shown below. J's outlining is double.

Actually, the project was not able to build itself. And Build Path was not shown under Project Properties. So just go to Project > Properties > Project Facets and tick Java from there.
That's all.

Have you tried to open Package explorer(the thing that shows all the files)?
If not go to
window--> show view --> Package explorer

Related

java - Eclipse gives me an error when i create a new project

I am using Eclipse IDE Galileo, on windows 8.1
When I want to create a new project, I go to file> new> java project.
I name my project then click on finish.
I then open the src file under my project and right click it. new> class. And I name my class
But before i even write any program, I have these errors. So can anybody please help me? Thanks in advance.
Here's the errors:
NOTE: My friend have the same problem, but she is using windows xp.
Dear #rebecca richa This problem will occur if your project have not JDK libraries. To add JDK libraries follow the following steps
right click on project --> Properties --> java build path --> select Libraries tab --> now click on Add Library --> select JRE System Library --> select Workspace Default JRE
your problem will be solved. other wise click on alternate JRE and select the path of jdk in your system where you have installed. now your problem will definitely solved.
for further help follow the image below
Seems like eclipse couldn't find Java Classes for your project.
Do This...
Right Click your project
Hover on Build Path
Select Configure Build Path...
Select Libraries Tab in the newly opened window
Click Add Library
Select JRE System Library from the newly opened popup
Close the Window using OK
This should remove the errors

Java source code not shown in Eclipse debug view

I am doing remote debugging of a Java application and using the debug view of Eclipse. The basic debugging process is working fine and I can see the method stack traces in debug view at the relevant breakpoints. However, I am not seeing the corresponding source code in the tab below and it is saying:
Source not found
The source files are already in my Eclipse project and I can see them in the Java view. I have edited the source look up paths and added the *.java files to it. But even then I am not seeing the source code in the debug view where the execution halts. Any clues on this would be appreciated.
For the Run/Debug configuration that you have been using to Remote Debug, have you followed these steps :
“Run -> Debug configurations…”
Choose the remote config from the tree on the left
Click on the “Source” tab
Click on the “Add…” button
Follow the wizard (add the Project containing the source which is being debugged).
If so, can you post a snapshot of the Run Configuration ?
What I have usually done with a Remote Debug run configuration is Add Source as Java Projects to the Source tab on the Run/Debug configuration. Thus to add a project called so, I would proceed as follows :
And when choosing the project, select the two checkboxes :
To end up with this finally :
I have done the below steps and it worked for me:
Run > Run Configurations
Java Application > Click on Source Tab
Include the project by selecting the option "File System Directory"
Debugging started showing the source code.
You are probably using JRebel which is automatically recompiling and reloading classes. Unfortunately Eclipse Debugger doesn't work with class realoaded in this way. In order to make sure that Eclipse will work fine with the class after changes you have to restart your web application container.

"Source not found" message in Eclipse with JBoss at debug mode - breakpoint is in MY CODE

I started up JBoss in debug mode, my project is built by Maven, I work with Eclipse, the only breakpoint is in my code. But when I run the app it stops on a window with a name as the class I've put the breakpoint in, but it only shows the "Source not found."
What is it supposed to mean in my case, and how could I overcome this?
I am not an expert in debugging with Eclipse so I would appreciate a thorough explanation!
Just Below Source not found error you will see "Edit Source Lookup Path" button click on it and then click on Add button then Java Project and include your imported project .. Hope this will solve your problem
You might have configured your Debug settings for a particular project in your workspace(in eclipse) which is deployed in JBOSS as jar or war, if the breakpoint is inside code that may be inside some other project(jar, war) which may be a dependency of the project for which you configured your debug settings then eclipse would not be able to find the source code. this is why you need to 'edit source look up' to the source code containing the source
There should be a button 'Edit Source Lookup Path' where you can add the location of you source files (where you put the breakpoint).
Try adding your file system folder of the project in the JBoss server configuration:
Servers (tab) -> Red Hat JBoss EAP 7.4 (right clic) -> Open (option) -> Open launch configuration -> Source -> Add -> File system directory (select your project folder) + Search subdirectories.

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