Javadoc not configured correctly - eclipse

Im getting a message like in the picture that my Javadoc is not set up correctly. I have already tried downloading and added the URL and jar file to java JRE in preferences under installed JRE's.
I dont know if it matters but my dependency is coming from artifactory.
Im also running eclipse 4.9
Im trying to add
https://fasterxml.github.io/jackson-databind/javadoc/2.6/index.html
https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/

Figured out the issue.
To solve it:
Right click java project -> Properties.
In properties select Java Build Path -> select the Library tab.
Here I untwisted Maven Dependencies, and untwisted .jar file.
Select Javadoc location and click edit on the right side to add the documentation URL.

Related

Can´t run acceleo uml2java example

I´m beginning with Acceleo.
I installed eclipse-modeling-luna-M6-win32.
Then i installed acceleo by update on eclipse.
(is there any better option?)
Trying to use the uml2java example.
To run it i tried to run org.eclipse.acceleo.examples.uml2java.
It gave me:
Error
Couldn't load class org.eclipse.acceleo.examples.uml2java.main.Uml2java from project org.eclipse.acceleo.examples.uml2java
Couldn't load class org.eclipse.acceleo.examples.uml2java.main.Uml2java. Check that its containing package is exported.
I did not change the code.
I checked the MANIFEST and it has on the runtime: org.eclipse.acceleo.examples.uml2java.main
I also saw that there is an UI project that as i understand is a plugin but i don´t know what to do with it (so that it will create a new menu on eclipse).
Any help is appreciated!!
Thanks.
it worked using eclipse indigo with the latest acceleo. i don´t know if it´s possible to use a more recent eclipse version. also works with eclipse kepler.
This fixed the problem for me. Try adding the "bin/" directory to the Classpath in the Manifest file.
Right click the MANIFEST.MF file and "Open With >" "Plug-in Manifest Editor".
This gives some tabs at the bottom. Use the "Runtime" tab. On the bottom right of this screen there is a place to edit the classpath. Add "bin/".
I got this idea from Etienne's answer in: Can't generate java from UML using Acceleo in Eclipse

Hadoop Documentation for Eclipse

I recently installed Hadoop and am able to run simple programs.
However I would like to view documentation for Hadoop classes within Javadoc browser in Eclipse.
Please let me know how to enable that (I am a little novice with Eclipse IDE).
Thanks.
A couple of suggestions:
If you're using maven for your dependency management, you should be able to expand out the list of Maven dependencies in your Eclipse project, right click the hadoop-core-x.x.x.jar and select Maven -> Download Javadocs
Otherwise you'll need to source the Javadocs from the $HADOOP_HOME/docs/api folder and associated with your hadoop-core-x.x.x.jar in Eclipse. In Eclipse, right click your Java project and select Build Path -> Configure Build Path. Now click the Libraries tab and locate the entry for hadoop-core-x.x.x.jar. Expand the entry to show options for Source, Javadoc etc locations and click the Javadoc location entry. Now click the Edit button to the right and enter the location as the path $HADOOP_HOME/docs/api in the Javadoc URL text box (mine is file:/opt/hadoop/hadoop-1.0.2/docs/api/)
Either way now you should be able to hover over Hadoop classes in Eclipse and the Javadoc will popup. You can also show the Javadoc window that will populate for the class you are currently viewing, or just open an internal browser window and point it at the $HADOOP_HOME/docs/api/index.html file
Another easy solution for those who want to stay updated is to edit the Javadocs path like Chris said:
"In Eclipse, right click your Java project and select Build Path -> Configure Build Path. Now click the Libraries tab and locate the entry for hadoop-core-x.x.x.jar. Expand the entry to show options for Source, Javadoc etc locations and click the Javadoc location entry. Now click the Edit button to the right and enter the location as the path"
but instead of linking it directly to the api you have stored on your hard disk, link it to http://hadoop.apache.org/docs/stable/api/

How to change Liferay Portlet Plugin API library in Eclipse?

I have switched my web-application to run on another installtion of Liferay. Consequently, I was able to changle classpath libraries in my project to new server location. This includes JRE System Library and Liferay v6.0 CE. I.e, both these libraries can be added for new server location from Java Build Path dialog.
But the library "Liferay Portlet Plugin API" still refers old Liferay installation path and I see no way to change it.
How is it possible?
UPDATE 1
Here: http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+IDE+Getting+Started+Tutorial
On the very most low picture you can see all three libraries listed in Package Explorer. Two of them I was able to change and the question is about third one.
You can manually change file .metadata\.plugins\org.eclipse.jdt.core\variablesAndContainers.dat.
So open your filesystem browswer (My computer) navigate to your liferay IDE workspace location and go to .metadata\.plugins\org.eclipse.jdt.core. Open file variablesAndContainers.dat and find and edit your jars locations.
After that restart Liferay IDE or simply close and open your project.
UPDATE:
1) Take note of jars that are needed
2) Go to configure build path dialogue than go to libraries and select "Liferay Portlet Plugin API" then click Remove
3) Create folder "lib" directly in your project (not WEB-INF/lib)
4) Add jars to lib folder (from 1.)
5) Select jars and add them to build path (right click - Build path - add to build path)
Or you can crete you User libarary with those jars and than add it to build path
Additionally to chosing correct libraries in classpath dialog, one should also change "target runtime" appropriatedly by right click project and going to properties > Targeted Runtimes.
P.S. And plus one should close project and then open it again.
in my case, following instructions in this question about clearing eclipse cache (-clear option) helped, as changing liferay plugins SDK path wouldn't change the libraries' locations when adding this library to project build path...

Red exclamation mark in Eclipse with mercurial

I have imported a project with Mercurial (hg clone ...).
When opening it with Eclipse, a red exclamation mark appears by the project's name in the Project Explorer, and it cannot be built. Silly messages like "import java.util cannot be resolved" appear, and errors in files are not marked in the Package Explorer.
How can I resolve this?
Check the problem view. By exclamation it is usually means a problem with build path
Check the Build Path of the project by right clicking the project and select Build Path -> Configure Build Path.
One problem I often encountered is different people using different Java SDK and so when the exact SDK is not available in your machine, you need to change to your Java SDK (via JRE System Library -> Alternate JRE). A better way to avoid this problem is to always select the JRE System Library from Workspace default JRE or Execution Environment.
I solved the problem by adding the external .jar file in to my project.
RightClick on the project -> Properties -> Java Build path -> libraries tab -> Add jar
Select your jar file and added it
Thats it the red ! mark gone.
Some times it happens that you have added a jar file earlier but currently not using it. Then after some time you delete the jar file from your system. But since you are not using the library file, so you will not get any error.But then you will see the red exclamation mark for the project. So all you need is to remove the added jar from the Build Path.
Done.....
The Java Runtime Library was defined wrong for the pulled project.
It had to be reset under Project | Properties | Java Build Path | Libraries.
It means there is a problem with the build path in your project. If it is an android project then it mostly means the target value specified in project.properties file cannot be found. This can also be caused because of other kinds of built problems. But it is shown mostly for built problems only. See here for more details. It is about built error decorater seen in eclipse.
An extract from that page:
Build path problems are sometimes easy to miss among other problems in a project. The Package Explorer and Project Explorer views now show a new decorator on Java projects and working sets that contain build path errors:
The concrete errors can be seen in the Problems view, and if you open the view menu and select Group By > Java Problem Type, they all show up in the Build Path category:
I figured out each time i am trying to import a library into my android project, i have a red exclamation mark with both ActionBarSherlock and Facebook libraries
This is how i solved it:
After adding the library into your project "project properties->Android->Librairy->add"
If you are using Eclipse, all you have to do is to clean your project and build all your workspace:
"project -> clean... -> "clean selected project" -> build the entire workspace
For me, the problem was a simple one - the reference project was compiled in 1.5 and my project 1.6. Matching the two solved the issue.
Right-hand-click on the project, select properties, select java compiler.
This is how I solved this problem:- Right-Click to project->properties->Java Build Path->Libraries(tab)->Remove the Jar which is already present there with a Path given along.

How can I add my application to Tomcat in Eclipse?

I have a web app built with Maven.
Most of the time, I built the application using Intellij IDEA, but now I want to import the application in Eclipse to see something in this IDE.
After mvn eclipse:eclipse, I add in Eclipse the app, but when I try to add the app to the server (tomcat), I receive:
There are no resources that can be added or removed from the server
Solutions?
You need the project to have a Eclipse Dynamic Web Module facet. You can try doing this via the project properties dialog and looking at project facets, then clicking the appropriate check box. This may not be available however, so you may need to do the next thing.
Create a backup of your project and follow the directions at dzone.com. This'll allow you to modify the project facets via your eclipse .project file.
Keep in mind, once you add those facets, you cannot change them back via Eclipse. Definitely make sure you have a backup before starting.
This step worked for me:
Right-Click on the Project Name, then
Maven-->Update Project..
Click OK
After doing this I was able to see my project in Add/Remove Programs.
As mentioned somewhere else adding Eclipse WTP didn't do any good, however I performed the above step after I had already added Eclipse WTP, so I am guessing that may not be needed.
This was done for Eclipse Juno.
Hope this helps someone.
Edited: You can follow this link as above mentioned I think might have needed WTP and that add a lot of other things into the workspace.
http://blog.teamextension.com/maven-as-eclipse-dynamic-web-module-556
Check whether Maven Integration for Eclipse WTP is installed. If not, install it from Eclipse Marketplace
After installation restart Eclipse
Right click your project and Maven--> update project configuration
Delete tomcat and re create tomcat (clean tomcat,add your project,publish and enjoy)
I've got Tomcat 6, Java 1.6, and was trying to get it to work in Eclipse Juno Service Release 1's "internal server" (whatever that's called.) Here's what I did that worked for me:
(Found these instructions at http://www.mkyong.com/eclipse/eclipse-ide-tomcat-version-6-0-only-supports-j2ee-1-2-1-3-1-4-and-java-ee-5-web-modules/)
I should point out that I followed ClutchDude's instructions to make my project a Dynamic Web Module facet. It didn't work on its own for me, but maybe it was part of making it work in the end.
Using Eclipse (or other text editor), open the file
.settings/org.eclipse.wst.common.project.facet.core.xml
Find the line that reads
<installed facet="jst.web" version="3.0"/>
3.0 is for Tomcat 7.x (so says mkyong.) Change it to 2.5 (or 2.4).
I restarted Eclipse and it worked for my project.
The reason why this is happening is because eclipse by default looks for the deployment descriptor in the folder {project.home}/Webcontent/WEB-INF/web.xml where as the Maven puts them in src/main/webapp/WEB-INF/web.xml.
So when you are trying to add your project onto the server eclipse cannot find a deployment descriptor and hence you get the annoying message.
This can be solved by adding the following entries in .settings/org.eclipse.wst.common which can be found in
Project home folder in your workspace if it is a new maven project.
The folder where you already imported from if you are using Import -> Maven projects.
Make the following changes in to the org.eclipse.wst.common
wb-resource deploy-path="/" source-path="/src/main/webapp"/. Add this entry.
Edit --> property name="java-output-path"
Please check the following link from more details. http://java.dzone.com/articles/webapps-eclipse-and-maven.
The comments section has an excellent example with a working project.
This issue was fixed for me my installing additional eclipse modules. in particular, the ones related to m2e-wtp. just do a search for m2e in the plugins search listing for your version of eclipse
If you face an error like "There are no resources that can be added or removed from the server",
then
1) Go to the META_INF of your websvcsEAR and go to the application.xml.
2) Goto modules-> clickDetails and add the module that is existing. i.e., some EAR which your project demands.
3) Click ok
4) Now go to your server -> right click -> add and remove -> add your EAR.
Maybe you don't need add your application to the server's configuration. I think that you must use m2e eclipse plugin in order to launch the app.
For example, in your eclipse you will see a contextual menu called "Run as" if you right-click on your pom file. You can clicking on "Maven build" and Maven will download all the information needed to start tomcat.
I hope this helps you.
I used
mvn eclipse:eclipse -Dwtpversion=2.0
in command line in the folder where I had my pom.xml. Then I refreshed the project in eclipse IDE. After that I was able to add my project.
I was able to resolve this by removing my EAR project from my Eclipse workspace, then re-importing it.
Well, with a Spring and maven project, i got it that way:
Eclipse Version: 2019-06 (4.12.0)
Java 1.8
Tomcat 7
Yes, go to Project Properties >> Facets >> select Dynamic Web Module but dont apply yet!!!
Right under, it should appear a link Further Configuration Available. Click on it, otherwise one will have to edit .settings/org.eclipse.wst.common.component manually. Update source directory to src/main/java. (source)
Then in Facets window check Java - mine was pointing to 11 even though i don't have Java 11 installed or configured like a JRE runtime. I could only add/remove when changed to 1.8. (source). Note: That was really the problem, why don't Eclipse get this configuration automatically from the project?
Finally Eclipse creates some directories like WEB-INF and META-INF, just delete them.