Java Decompiler plugin in Eclipse with JavaDoc - eclipse

I add a decompiler plugin JadClipse in Eclipse but I am facing a issue that decompiler removes the JavaDoc from the code. Only the simple code is made available, can anybody suggest me any available Eclipse plugin to resolve the problem.

JAD doesn't remove the JavaDoc - there simply is no JavaDoc in compiled code.
What you want is to add JavaDoc to decompiled code. There is no plugin for that (and I think writing one wouldn't be easy).
If you have the JavaDoc as a JAR, you can tell Eclipse to show it in the project's settings. That way, you might be able to see the docs when you hover over a place where a method is used - if you hover over the decompiled method, this probably won't work (I think the decompiled source will take precedence over anything else).

The solution to add manually each javadoc is a bit heavy if you have many librairies in your project, which is often the case.
If you have Maven integration, the solution to have the javadoc accessible is to tell Maven to download it.
In Eclipse Project Explorer :
Right-click on your projet -> Maven -> Download JavaDoc
There should be an equivalent for Graddle which I've never used yet.

Related

How to add java source code for AspectJ in eclipse

I am learning AOP with Spring framework and I want to set the javadoc for AOP in eclipse. So what I did I downloaded aspectj-1.8.10.jar from eclipse web site https://eclipse.org/aspectj/downloads.php#install then I installed that jar and got 4 new jar files: aspectjrt.jar, aspectjtools.jar, aspectjweaver.jar, org.aspectj.matcher.jar which I added to my class path in eclipse. Now what I want is to add source files for these jars so, for example, when I hover over #Aspect I want to be able to see what this annotation represents. Unfortunately I can not find the source files for these jars, on the eclipse website mentioned above there is a file aspectj-1.8.10-src.jar but I'm not sure what to do with it, I tried to attach this file directly in the build path for each of the jars mentioned above but it didn't do the trick. Also I thought that maybe I had to install aspectj-1.8.10-src.jar the way I installed aspectj-1.8.10.jar so I would get 4 source files, but I'm not sure how (if possible) to install it, when I double click aspectj-1.8.10-src.jar, installation does not get triggered.
So can you please help me out to add javadoc for AspectJ 1.8.10 in Eclipse?
Select the library in your Eclipse project explorer window, click right button, select properties, select javasource attachment or javadoc location and enter the path to the source or javadoc file.
But I would suggest to use maven to maintain the dependencies of your project. It makes getting javadoc much easier, because libraries, source code and javadoc are fetch from a central repository. You just add the library you need in your project configuration (pom.xml file) and the other files are fetched for you.
You do not need all those libraries. Please first learn which one serves which purpose. E.g. aspectjrt is the runtime. When using Spring AOP you actually do not really use AspectJ, only a subset of its syntax. Thus, the runtime is needed for identifying some of the annotation classes. However, aspectjweaver is only needed if you want to use full AspectJ in a load-time weaving (LTW) scenario, with or without Spring. The weaver lib is a superset of the runtime, so you only need one of them. Last, but not least, aspectjtools again is a superset of the weaver lib and contains the AspectJ compiler (among other tools). This is only needed for compile-time weaving as part of your toolchain.
I do not think that source code and Javadoc will help you much in learning AspectJ. I suggest you read the Spring manual's AOP chapter describing both proxy-based Spring AOP and full AspectJ integration via LTW. If you want to learn AspectJ basics and maybe just use AspectJ without Spring (which is what I do), read the AspectJ documentation.
If you are still not convinced and want to add source and JavaDoc to your Eclipse project, why don't you follow jaysee's advice and use Maven? Then you get all the source/javadoc libs for free. But anyway, you can also load those JARs directly from Maven Central, e.g. the source and javadoc for AspectJ runtime 1.8.10. Good luck! But I assume you will be disappointed because the AspectJ JavaDoc is really bad for learning purposes and not suited to understanding how to actually use AspectJ.

Creating new PlayN project in eclipse does not have java content-assist

I created a new PLAYN project based on the "Generating a skeleton project with Eclipse" instructions on the wiki
( found here: http://code.google.com/p/playn/wiki/GettingStarted#Generating_a_skeleton_project_with_Eclipse )
Everything was set up correctly but Eclipse doesn't recognize it as a java project so I lose the syntax checking, content assist, etc (I get run-time error dialog box when content assist tries to help) for java.
I get "compilation unit is not on the build path of a java project" followed by "The 'org.eclipse.mylyn.java.ui.javaAllCompletionProposalComputer' proposal computer from the 'org.eclipse.mylyn.java.ui' plug-in did not complete normally...".
Did I miss a step? Is there a way to add it to the project?
I tried editing the .project to add a java nature but that really messed up the project structure constructed by maven. (based on How do Java and Maven builders work together in eclipse?)
I tried adding a java builder to the project properties and looked adding a plug-in dependency in Maven but couldn't figure that out (I'm still learning Maven).
thanks.
Make sure you are writing code in the [project-name]-core Eclipse project rather than the [project-name] Eclipse project.
Searching around internet I found several reasons for this error. In my case the problem was that the project's nature was not Java.
To fix that:
close the project
edit file .project on project's root
Add the following line to section:
org.eclipse.jdt.core.javanature
Done. Open your project and code assist works correctly now.

Configure Netbeans IDE for Play Framework

I know running:
play netbeansify
configures the IDE for the Play Framework.
My Problems:
I have no JavaDoc for the Play Framework
I cannot navigate to the Play Source
Has anyone managed to get that done.
BR, Rene
It's been long since I used Netbeans so I can't give you the To link the full steps, but:
The source is available here. You'll need to link it as "code source" to your project. IntelliJ IDEA prompts me to browse for the source automatically when trying to browse it if it's not available, I don't know if Netbeans may have something similar
I assume once the source is linked the Javadoc in it will be available. There is not too much, I warn you (this is not like Maven projects where you have the 3 jars: source, binary and javadoc). But the code is simple and self-explanatory.

Configuring Java Compiler->Errors/Warnings within pom.xml

I am looking for a solution for the stated problem. I already figured out, that the project-settings from "Project Properties"->"Java Compiler"->"Errors/Warnings" are going to .settings/org.eclipse.jdt.core.prefs (like e.g. org.eclipse.jdt.core.compiler.problem.enumIdentifier=error).
It would be great, if I could configure these settings in the projects pom.xml. Additionally it would be nice, to let the maven-compiler-plugin recognise these settings and apply them when beeing called on the command line or by a ci-tool.
Did anyone had the same problem yet?
Kind regards,
Avi
For one, maven would not understand eclipse compiler settings. Another, Eclipse uses ecj by default.
maven compiler plugin can be configured with the parameters that java compiler understands. It can take a few parameters as documented here, but doubtful if it meets the requirement you have.
Perhaps a candidate for a custom plugin?

Can I Configure m2eclipse through pom.xml?

With the maven-eclipse-plugin, using mvn eclipse:eclipse, you can specifiy eclipse project natures and builders that will automatically be added to the eclipse project.
Earlier versions of m2eclipse used the configuration block of the maven-eclipse-plugin and also let you activate natures and builders using the same mechanisms. This seems to no longer be the case because a) I can't find any reference to maven-eclipse-plugin in the m2eclipse sources and b) it just doesn't work :-)
So this is my question: is there any way to configure the eclipse project generated by m2eclipse from the pom.xml? Specifically: project builders and natures, but I'd be interested in other options as well.
The following thread summarizes almost everything. First, it explains that m2eclipse doesn't and won't support anything from the Maven Eclipse Plugin anymore because:
Sonatype doesn't maintain it.
It causes them too much troubles.
Second, it states that the m2eclipse way to handle additional project natures and builders is to write project configurators:
(...) we encourage writing configurators to add the natures and builders you want based on what it available in the POM.
See this link for a guide and this project for some existing configurators for checkstyle, findbugs, pmd.
I have now implemented this as a maven plugin I call maven-eclipseconf-plugin.
Unfortunately it's proprietary work for a client, so I can't share it. But let me describe what I do:
Tied to the lifecycle verify, I check for the existence of an eclipse .project file. If it's there, I check it for the presence of the builders and natures I want to automatically add (and you can deactivate this behavior by using a maven property or a stop file with a configurable name). You can also define configuration files that will be written (like .pmd, which is related to this other question of mine). The contents of the Configuration files can be specified inline, it can come from an external file, or from a URL. I also tried to introduce variable substitution in the config files where a special placeholder would be replaced with a multi-moduke-project's root folder, but I had to give up on that approach.
Anyway, the plugin gives me pretty much all the functionality of the maven-eclipse-plugin I ever used (of course there is a lot more though) and I'm happy with that. Perhaps I will build something similar once more in open source when this contract is finished.
Project configurators are the proposed approach. But the latest version of m2e-extensions is from early 2010 and developed against m2eclipse 0.10.x. There is a successor project called m2e-code-quality which is more recent and active and developed against m2eclipse 0.12.x.
But neither m2e-extensions nor m2e-code-quality do support FindBugs at the moment. And there are some other limitations with header files, exclusions and modified JARs.
I have successfully used a universal approach with AntRun, Ant and XMLTask to automatically add project natures, builders and configuration files for Eclipse plugins from pom.xml.