Is it possible to search for a bit of text through the source code of all the maven dependencies of a project?
For example: If you import the following sample maven project: https://github.com/ajorpheus/javadoc-mem-test/tree/search-in-jars, searching for tempHeaders should turn up AbstractClientHttpRequest.java as a search result.
Is there a plugin that allows one to do this?
If Intellij does not support this, would you know of an IDE-agnostic way to do this given a maven project? I have looked at tools like jarexplorer but they don't seem to do the job.
I found how to do this !
Use the 'Project and Libraries' Custom Scope.
in IntelliJ IDEA 2018, you can do this: ctrl+shift+f
thanks #Ashutosh Jindal
If I understand your requirement correctly, what you are trying to do is possible.
First in the Maven pane you need right click on dependencies and select 'Download Sources'.
Once that is done, follow Ashutosh Jindal instructions to search in your code and the dependencies code.
I have faced the same problem. There is two way to search in Intellij.
1. Ctrl + shift + F
2. navigate - > search everywhere or use Ctrl + N
To search in external libraries , you have to make sure they are downloaded first in your system then only you can search anything among them.
For IntelliJ 2020 go to the main menu, select Navigate | Search Everywhere or press Shift twice to open the search window.
For more information check here:
https://www.jetbrains.com/help/idea/searching-everywhere.html#search_all
Search everywhere example
First you need to download the source from maven tool bar
Related
I am working on Quarkus application in vscode and we want to add external jars to that application, I have seen few demos but in my project "Java Dependencies" tab is not there, how to show it?
Please Help me out as I am new to it.
This "Java Dependencies" tab is not visible in my above project.
Click your project under JAVA PROJECTS, click + to add Maven Dependencies:
Detailed information please view Project Management in vscode-java: Add a dependency
I know this is really late; I stumbled here when trying to solve this problem myself. Now that I have found the solution, I am sharing on this for anyone coming this way later so, here goes: You can simply click on the '+' button to add external JARs (see in the screenshot).
How would I export all my javadoc comments into a HTML pages similar to:
http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
or
http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html
This link
should be what you need. It covers how to generate JavaDoc HTML in Nebeans and Eclipse.
easy way... I would go with maven javadoc plugin.
http://maven.apache.org/plugins/maven-javadoc-plugin/
It's easy to do so with NetBeans. Right click on your project in the projects panel, click on Generate JavaDoc. If there's no error in your code, it will generate an HTML documentation automatically for your project and you're gonna find it, usually, in the dist folder of your project. I didn't check for Eclipse, but it must be a similar process in Eclipse, with one or clicks you generate your javadoc.
Update: Eclipse method: Select Project –> Generate JavaDoc
I have a problem with getting ZeroMQ to work on android. I compiled everything into the .jar and .so file that i needed. Then I added zmq.jar to /libs/ and the libjzmq.so to /libs/armeabi/ and added the .jar to the build path. (right-click -> build path -> Configure build path ... -> Libraries -> Add JARs...)
I've also marked the .jar for export in the "Order and Export" tab and moved it to the top of the list, but i still get "java.lang.NoClassDefFoundError: org.zeromq.ZMQ".
What else can I try?
I'm using Eclipse by the way.
Thanks in advance.
This is not a proper answer to your direct question as I was unable to solve the same problem. Recently I came across JeroMQ on the mailing list and am now using it in an internal application for instant messaging. It is working very well but requires ZeroMQ 3.x. ZeroMQ is very easy to install so that should not be a blocking issue.
Take a look at the GitHub repo here:
https://github.com/miniway/jeromq
If you are using Git, you can add that as a submodule or you can simply pull the code and add it into your main app. I would highly recommend the former, but I ended up doing the latter simply to get my test app up and running easier.
I got the problem too! The way it works for me is to set the package order in Preferences->Java Build Path->Orders and Export. Select the checkbox of zmq.jar, and click the 'up' button to make it in the first line in the list, then the error disappears happily, hope this would be helpful to you :)
I don't get the exact method to do this. I want a method not for a single project for all projects in eclipse. Please tell me how to solve this problem.
This is for a jar on your classpath in Eclipse, where you have
attached a javadoc zip which Eclipse for some reason dislikes.
NOT attached a valid source jar.
The easiest way is to right-click the jar in question (in the referenced jars, not the physical jar) and choose Preferences -> Javadoc. Here give a correct location (zip/URL) to the correct javadoc. Remember to use the "Validate" button to ensure that it is correctly set up.
Akki's problem also plagued me for much too long. But the fix is super easy.
If you're using Eclipse (Neon), and
If you have Maven (highly recommended) with the Eclipse plugin to handle it, and
If your project is a Maven project (it can be converted into one **),
Then you can easily add Javadocs to all your jar dependencies at once (if you're also using Spring Boot, there may be about 75 of them!) by doing the following:
Right click on your project (in the Project Explorer),
Hover over "Maven" to get a submenu, and
Select "Download JavaDocs".
You should see in the lowest right hand corner a status bar that says "downloading sources and javadocs" and a progress bar.
** To mavenize your project:
Right click on it in the Project Explorer,
Hover over "Configure" to get a submenu, and
Select "Convert to Maven Project".
This happened to me after I moved my Android files from one PC to a new PC: I simply copied the folder from P:\Android\ to C:\Android\
To fix the error (using Eclipse), right-click the library (in my case android.jar) in your project. Click "Properties", click "Javadoc Location", and fix the Javadoc location path.
For example, I changed it from "file:/P:/Android/android-sdk-windows/docs/reference" to "file:/C:/Android/android-sdk-windows/docs/reference"
Then click "Validate". Then click "Apply". Then click "OK"
now hovering over a method or constant gives me the API info again :-)
Assuming you're using Eclipse as an IDE, the statement (provided in your question title) means that the IDE cannot find a javadoc comment to display the method/class/attribute description (usually shown when hovering a class/method/attribute). To fix this, you need to attach a jar or zip that contains the javadoc comment. This is usually a source code for a specified class (as it contains comments, if the programmer provided comments) and the IDE will extract the javadoc comments out of it and display it appropriately.
Hope this helps.
This problem happened to me also when I upgrade to Eclipse Photon version. Use this following flow to attach Javadoc manually.
Go to Eclipse >> Window >> Preferences >> Java >> Installed JREs >> Select "JRE" and Edit >> Choose "C:\Program Files\java...\lib\jrt-fs.jar" >> Choose "Source attachment" and Source attachment... >> Choose External location >> Go to the path of "src" like "C:/Program Files/Java/jdk-10.0.1/lib/src.zip" >> Ok >> Finish >> Apply and Close.
I know this is a very late answer, but this will help if anyone is using a gradle project.
change your build.gradle to include the following:-
apply plugin: 'java'
apply plugin: 'eclipse'
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
This will add both java source and javadoc.
If this still doesnot work then right click on the Project>Build PAth>Configure Build Path>order and Export > and bring Web App libraries to the bottom Then Close the project and reopen it
Using Eclipse 4.2.2 on OSX 10.7.5, after I got the lib into "referenced libs", I had to then right click it > Build Path > Configure Build Path > go to Order and Export tab, then highlight the lib I want and move it up to the top with the "up" button. I didn't notice any difference with the checkbox checked or unchecked.
That's what got it working for me.
Also, after doing one of these in the UI, you'll see your .classpath file has changed- that jar now has a sourcepath attribute.
It's probably easier to quit eclipse and edit the rest by hand. Remove the foo-source jar files as separate jars and add them as sourcepath attributes on each classpathentry element.
To Solve this issue for all projects, the best way is to create a user library and import all your external JARs into that library. Then for each JAR add the javadoc URL into Javadoc location field.
So this way whenever you need to import the JARs under build path, always use user library. so you will have javadoc location already configured.
How can I add JavaDoc or other document to netbeans ?
I try with this way :
Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop)
but in editor when I press Ctrl+Space in tooltiptext this message shown :
Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager.
I tried restarting NetBeans but this was the result:
try this in NetBeans IDE
Choose Tools > Java Platform Manager from the main window.
Select the platform to which you want to add Javadoc in the left panel of the dialog box.
In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
Click Close.
Hope this helps.
If you are using maven in your project then follow below steps to attach Java docs for your attached libraries.
Right click on "Dependencies" folder of your project.
Then choose "Download javadoc" option
It will download javadoc of your libraries and attached it.
Now when you will press ctl + space then you will see docs for that library.
and If you want to add javadoc for particular library then follow the options as suggested by Himanshu Soni.
You can't usually just add the javadoc zip as a separate library (at least this hasn't worked for me in the past.) In the libraries section you need to select the library you want to add the Javadoc for and then add the Javadoc jar for that specific library.
Restart Netbeans then that should work. Though of course if there really is no Javadoc for that method you still won't get any (I've fallen into that trap a couple of times before!)
You followed the very right procedure, I've been threw this right before I write this answer, and as for this is the first result that shows up when you Google the problem, I think that many people will find it handy and save their time, the solutions is:
UNZIP the JavaDoc.zip file that you are referring to ( which is supposed to be jdk-7u4-apidocs.zip for JavaSE 7 docs) and repeat the same procedure, which is Tools --> Java Platforms --> Javadoc ( tab ) then press " Add Zip/Folder, and point to the unzipped folder instead of the zipped one, restart NetBeans, and it will work smooth and direct.
You should download the docs file from the following link:
http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
After completing the described operation, you will have your javadocs available offline, and you don't need to be connected to the internet to know about APIs.
Best regards brother.
"Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip"
The problem with above step can be solved easily by moving down following two path already added in content panel as shown below.
Step 1-
Goto: Tools >> Java Platform >> JavaDoc Tab
and Add ZIP/Folder you want to add.
Step 2-
Step 3-
That's all and if zip file doesn't works the extract first and then add it.
I had the same problem, and I solved it by removing all URLs and adding only the apidocs.zip downloaded from oracle. After that restart your NetBeans.
Before test whether it works be sure the method you are looking for actually exists within the apidocs. Open index.html and make a search for that particular package.class.method you need.
If it doesn't work, try to manually copy the apidoc.zip to the docs directory of netBeans:
C:\Program Files\NetBeans 7.1.2\java\docs and then retry.
this help me:
http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE
try it, maybe help
Using a Maven project inside of Netbeans v8.02.
First, view your project via the Projects window;
Expand your project's Dependencies folder
Right-click the desired *.jar file
Click download javadoc
Done!
This worked for me, I manually copy the apidoc.zip to the docs directory of netBeans: C:\Program Files\NetBeans 7.1.2\java\docs and then restart my netbeans.