Error after generating Javadoc for my project in eclipse - java

After I generated javadoc for my project on eclipse, the following error messages pop up on the console.
Does anyone has a solution to my problem. I tried to include de modules that are missing in the VM options during the wizards but it still doesn't work.
Thanks
EDIT: I fixed it. First I deleted my module file, then I created the javadoc. After doing that, I configured my module file again and it worked
screenshot of errors

Your mistake have nothing to do with the Javadoc.
You've got an error because you use JavaFX and you haven't load the dependencies in the classpath.
To resolve your problem :
Near the run button you have a arrow. Click on it.
You will have a menu, then click on "run configurations..."
A pop up will open.
Then find the name of your main class in the list on the left of the pop up.
Then go in arguments section
And in the field named "VM arguments" write :
--module-path pathToJavaFXJDK/lib --add-modules:javafx.controls,javafx.fxml
replace pathToJavaFXJDK by the absolute path of your JavaFX directory.

Related

Eclipse error: org.eclipse.core.nternal.resources.Project cannot be cast to org.eclipse.core.resources.IFolder

I have jdk 1.8.0_191 and Eclipse 2019-12.
This is what I'm doing:
Opening Eclipse
File > New > Dynamic Web Project
Fill Project name > Click next
On "Source folders on build path" it's empty. I just click next.
Fill "context root" and "content directory" with a value
Check "Generate web.xml deployment descriptor"
Click finish
Getting the following error when I click "Finish":
Failed while installing Java 1.8
Then there's an "Ok" and a "Details" button.
When I click "Details" it says:
org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.core.resources.IFolder
Then I click "ok", it closes the window and creates a folder with the project name. But the folder is empty. It does not contain all of the other files and folders that should be there for a Dynamic Web Project.
I found the issue.
Executed the same process in Eclipse 2021-03 and it worked.
Realized that the issue was on the second screen ("Source folders on build path").
In Eclipse 2021-03 that screen came already filled with the following info:
Source folders on build path: src\main\java
Default output folder: build\classes
But on Eclipse 2019-12 those two fields were empty.
So I just added that same info manually, proceeded to the end and it worked fine.
For some reason those fields are empty in that version of Eclipse in my machine (not sure if that's default for that version or it's something in mine. Most likely the second.).
Anyway, filling them manually resolves the issue.
Thanks.
You might find more details in file $workspace/.metadata/.log - most of the times something that goes wrong internally shows up there before the problem gets visible to you (the cast exception is probably a follow-up error, and in itself not telling much).
If there's nothing immediately remedying in there, you could file a bug report in the Eclipse bug tracker (with log file provided), and hope that someone will investigate what might have gone wrong in the two year old release.
Does the problem persists with current versions of Eclipse and JDK (where development is focused)?

All my lines of code in my 'src' folder have errors in Eclipse

Am having problems with development in android as all my lines of code in all the files in the src folder where am placing my java files have errors on them. I do not know where the problem is coming from!
First had problems where 'R' was underlined in red. then after Ctrl+Shift+O, I exited my eclipse and on opening it, that's what I saw on my java files
Go to
Project Properties>Java Build Path>Libraries tab
and make sure JRE is added, if not, click "Add Library..." and add it.
All errors seems related to Android's specific classes:
you may have a problem with you Eclipse+ADT installation
you may have pasted the code into the wrong type of project
you may simple missing the corrisponding import
Last is simplier to verify, just hover with mouse over the error and see if Eclipse suggests you to add a specific import

Error in Eclipse: "The project cannot be built until build path errors are resolved"

I am a computer science student learning Java, so I do some work at home and at college on a mixture of Linux and Windows. I have a problem after copying a new project into the Eclipse workspace. The project shows up, but with a red exclamation mark and an error saying:
The project cannot be built until build path errors are resolved
How can I fix this? I tried the solution described here, but it didn't work.
Identify "project navigator" or "package explorer" view.
Right click on your project, select Build Path --> Configure build Path.
In the emerging window, you will find four tabs, select "Libraries".There, under "Web app libraries" (expand it), you will see the libraries added to the project's classpath. Check if all of them are available. If one or more are not (they'll have "missing" beside their name and a red mark on their icon), check if you need them (perhaps you don't); if you don't need them, remove it, if you need them, exit this window, look out for the missing jar and IMPORT it into your project.
Open the Problems view. You can open this view by clicking on the small + sign at the left hand bottom corner of eclipse. It's a very tiny plus with a rectangle around it. Click on it and select problems.
The problem view will show you the problems that need to be resolved.
If the message says "the project is missing the required libraries...", you need to configure your build path by right clicking on your project, selecting properties, then build path. Add the required jar files using the libraries tab.
-If there are other problems other than missing libraries, you need to post the exact problems here to get a precise solution.
If you can't find the build path error, sometimes menu Project → Clean... works like a charm.
In my case, all libraries in the build path were OK.
To solve it, I deleted all project metadata (.project, .classpath, .settings) and re-imported the project as a Maven project.
Right click your Project > Properties > Java Build Path > Libraries
Remove the file with red "X" (something like JRE...)
Add Library
That's how I solved my problem.
I also had this problem in my system, but after looking inside the project I saw the XML structure of the .classpath file in the project path was incorrect. After amending that file the problem was solved.
If not working in any case...then delete your project from the Eclipse workspace and again import as a Maven project if that is a Maven project. Else import as an existing project.
I tried all the previous given solutions, but they didn't work, but it works for me.
In Eclipse, go to Build Path, click "Add Library", select JRE System Library, click "Next", select option "Workspace default JRE(i)", and click "Finish".
This worked for me.
Go to Project > Properties > Java Compiler > Building
Look under Build Path Problems
Un-check "Abort build when build path error occurs"
It won't solve all your errors but at least it will let you run your program :)

How to find the error displayed on my project.?

I am writing the code in eclipse. In my project explorer there is an error(red x mark) displayed on my project name. But there are no errors in the other sub folders.Can any one say where can i find those errors.? What is to be done to find the problem. Thanks in advance
The errors from Eclipse are usually avaiable from Error Log View
Window -> Show View -> Erro Log View
Also you can try to clean and rebuild the project.
One possible cause for such thing is build path issues. Go to your project build path and look at the list of included jars: check if you have any jar marked with the same red x. Also, check the eclipse "Problems" tab.
Go to the 'Problems' tab (hit Ctrl-3, then start typing Problems). It will give a description of what's wrong.

How to figure out what error my Java Eclipse project has?

I've created a Java project from existing source with an Ant build script in Eclipse. I cannot run my project because Eclipse tells me that there is at least one error in it.
Now, I know that the project runs fine on the command line, so I suspect an Eclipse configuration error.
As far as I can tell, the only feedback that I have from Eclipse is
a little red X on my project in the Package Explorer window
(source: gregmattes.com)
and dialog window when I try to run the project says there are errors in the project
(source: gregmattes.com)
This is all wonderful, but what is the error?
Is there a "show me the next error" button somewhere?
In the past, on other Eclipse projects, I've notice other little red X's on folders containing source files with errors, the little red X's appear on the source files as well. I scanned (manually) through all of the source files and I haven't found any other red X's (again, where is the "next error" button?).
If I select the "Proceed" button I am greeted with a java.lang.NoClassDefFoundError for my main class, which makes me suspect a classpath issue. I've checked the classpath, and I'm fairly certain that it's correct. Is there a way to see the exact jvm command line that Eclipse is invoking? I realize that it might be invoking the JVM programmatically, and not on a "real" command line. In any case, is there a way, other than the run configuration dialog, to see what is actually happening when I hit the "Proceed" button?
The errors are shown in the Problems view. If it is not opened, go to:
Window > Show View > Problems
Also accessible with the keyboard shortcut Alt+Shift+Q,X
Selecing Window -> Show View -> Problems will open the Problems view, that should have a list of all problems, their location and nature (it can be configured to show only project- or file-local problems, so you may also have to click on the project). Most likely you have a config error in your project, e.g. a reference to a JAR library that cannot be found.
View Errors/Warnings Project based
if you get that kind of an error which shows a red cross on the project folder just refresh that project right clicking on it i was having the same problem as above so try and see...

Categories

Resources