I don't see the documentation in my Maven project for Java dependencies that are decompiled from .class files. It does work for external Maven dependencies.
I have activated the following settings.
Settings->Importing->Automatically Download->Sources & Documentation
And also, right click pom.xml and download documentation there.
How can I make IDEA fetch documentation for these core Java files?
Refer screenshots below to see examples of both scenarios.
You need to make sure the sources are attached to the JDK configuration. It should work out of the box, but it could be that your JDK installation is incomplete and is missing the sources.
src.zip must be present in the Sourcepath of the JDK configuration:
Try reinstalling JDK from the official download page and configure it again in IntelliJ IDEA.
Related
So, I am using a plugin from the Intellij IDEA Marketplace and I'd like to modify it to my needs. The plugin is Open Source(Apache License) but I couldn't find its source code on the internet. I know that plugins are located under Users directory in Windows, so I could decompile the jar and see the source code. But the problem is that this plugin contains some dll files as well.
Is there an easy way to debug the plugin and set breakpoints etc. to see where I will need to modify the code(the other option would be to include the decompiled java source files in a new plugin build but I don't know what to do with the existing dll files).
Thank you.
Intellij Idea plugin development requires a project structure and it requires gradle-intellij-plugin. If you are able to compile the source code, you have to create gradle project with gradle-intellij-plugin. First of all follow the links to create a small plugin to understand how to create a plugin.
https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system.html
As a sample project, you can refer below the github project.
https://github.com/debjava/ddlab-gitpusher-idea
I'm trying to attach the java docs in my eclipse IDE and I am a little bit confused.
I've seen an answer where I had to click on project> properties> JavaDoc location> then insert java doc/api.
Yet another said I had to click on Window> prefernce> Installed Jre>edit> select /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar.> attach java doc/api. I did that for all the jar files
In both cases, it doesn't seem to work. I still see the not attached java doc message for packagejavax.jms. I'd like to have the doc for all the classes I have in my eclipse project. It is an osgi project so I'd like to do it for the whole project and not for individual plugins.
****UPDATE****
Also tried using maven eclipse integration i.e install plugin> click on download artifact source and javaDoc. Didn't work.
It looks like it has to do with the plugin dependencies. When I attach the java doc to the jar in the plugin dependency and restart eclipse there's no javadoc attached. I guess there's another way of doing so with jars found in Plug-in dependencies.
Can anyone help? Thanks.
I am quite new to Java and Eclipse.
I am trying to call some functions from the jpf library from a program that I am writing in Eclipse.
Can anyone help me load or install these libraries into my Eclipse project? The .zip files are here. If these are already in the Eclipse program or there is some better way to get them, can someone also post that answer in addition to how to load any arbitrary java library.
Thanks for the help.
The JPF project page, to which you already linked in your question, contains a section about setting up the Eclipse IDE for JPF projects. A more general webpage on how to add external jars to your eclipse project might be helpful as well
download desired jar in to your local machine - add those jar to your project using below
right click on your project - configure build path - libraries - add
external jars - browse downloaded jars - add
Download and extract jpf-bin-1.5.1.zip. In here, you will find one or more JAR files. Add them into your Eclipse project, under something like a "lib" folder. Right-click on the JAR files from there, then choose "Build Path" / "Add to Build Path".
Or better yet, investigate the use of Apache Maven, and let it handle all of the dependency resolution for you. (Per http://jpf.sourceforge.net/roadmap.html, this project is at least Maven-enabled.) At least the 1.5 version is also available from the central Maven repository at http://repo1.maven.org/maven2/net/sf/jpf/jpf/. I don't see 1.5.1, but the jpf-bin-1.5.1.zip contains a "MAVEN.txt" that explains how to install it into a local Maven repository for use.
check how add libraries in eclipse.
http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F
Also check this how make user libraries in Eclipse and then add them in your project.
http://i-proving.com/2006/07/18/user-libraries-in-eclipse
I am using maven, when I click some method of JDK from Eclipse, I received the error like
"Source not found". I am wondering how to get the source code of JDK from Maven?
Which class(es) are you attempting to look at? Assuming you installed a JDK and configured Eclipse to use it - and not a JRE, which doesn't contain the src.zip with the source code, this should work in most cases. An exception is for many (if not all) of the com.sun.* classes and others that are only available under the SCSL or the JRL licenses - which is available through a separate download from Oracle, after accepting one of these licenses.
I don't know what Maven has to do with this. You can find the JDK source in the src.zip that comes with your JDK. I don't know how to tell Eclipse to use it: I'm an IntelliJ user. There must be an attach source plug-in or command hidden in there somewhere. Point it at your src.zip and you're in business.
If you want to attach the source code of JDK, please reference Attach the Java Source Code
If the source you want to look is from third-party library like spring, you can tell maven to download the source code when you generate eclipse project
mvn eclipse:eclipse -DdownloadSources=true
But not all source can be download unless the source code maven artifact is published to maven repository.
Even more you can download Java doc with this argument when generating eclipse project
mvn eclipse:eclipse -DdownloadJavadocs=true
You can get more info from Maven Eclipse Plugin Link
Hope this will help you.
I was trying to add Ant libraries to a project in eclipse, and I used the ones that were part of eclipse's plugins folder. When I tried to associate them with Javadocs, I couldn't locate them in the plugin folder. I searched for them online, and I found this page, in which they say the docs are not provided online because they are part of every distribution. So where can I find the docs in the distribution that came bundled in Eclipse?
The ant javadocs may or may not be included with eclipse, depending on which version you have. Edit: Anyway, it's better not to depend on the version bundled with the IDE. Otherwise everyone who works on the project will have to use the same version of the IDE, and eclipse automatic updates can break your project.
Download the ant binary distribution and ant source distribution
Take the eclipse ant distribution out of your project and replace it with the binary jars (extracted from the zip).
In the eclipse java build path window attach the source zip to the binary jars. (Click the plus, double click "Source attachment" and select the source zip. You'll be able view the source if you want, and the javadoc will appear in the appropriate views.
I do not completely agree with Motlin's answer:
the process described is correct ("attach the source zip to the binary jars"), except the source code of all ant components is provided with eclipse distribution.
If ant is a plugin for eclipse, in [eclipsePath]\eclipse\plugin\org.apache.ant_1.7.1, [eclipsePath]\eclipse\pluginalso contains org.apache.ant.source_1.7.1.jar, including within it all the sources.
I confirm [eclipsePath]\eclipse\plugin\org.apache.ant_1.7.1 is there, but only in the SDK distributions of eclipse with sources included:
SDK eclipse (or "classic eclipse)
Modeling
RCP for plugin development.
This table summarizes the eclipse distros which come with sources included.
So, in the event you do not have access to any other ant stand-alone deliveries, you could use one of this eclipse distros to program and find in it a full ant distribution.
However, as pointed by Motlin, that is not the safest path to consider.