How to debug third-party Intellij IDEA plugin? - java

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

Related

Where should I write the code in Intelij IDEA after installing HtmlUnit and Gradle?

I first downloaded HtmlUnit and Gradle, then I did integration with IntelliJ, and when I want to write the import code to using HtmlUnit, I don't know where to place this code in IntelliJ,
And I have used IntelliJ many times, just have other folders now
I have attached project structure of my IntelliJ if it could help,
Thank you!
I tried to write code in all kinds of folders but it would have looked wrong, I hope I can know where to write the code after installing the plugins in Intelligence
Java has certain ideas on where source code needs to go; it's a mapping from packages to folders. A class Foo needs to be in Foo.java. If that class lives in the com.example.java package, that needs to be in a folder com/example/java. This should be covered in any textbook or tutorial. IntelliJ just follows these standards.
Gradle also has its opinions on how a project should be organized. You can run e.g., gradle init --type java-application to have Gradle create a standard folder structure for you. (The gradle folder is for Gradle itself.)
You will end up with a src/main/java/ folder for your source code and a src/test/java/ folder for your unit tests.

Running Java based open source

This is my first time to use Java, and I have no experience in Java, but good experience in .Net
I have downloaded an open source code called ctakes
and downloaded IntelliJ IDE community version
i pointed to the main folder of the project to be opened by IntelliJ IDE
but when i try to run it, it does not work
not sure what the problem is and how to fix it.
I want help in making the code runs successfully, any help appreciated.
Assuming you are talking about this repo, this is a maven based project. In order to import it correctly, follow this link
and refer to Open an existing Maven project section.
A maven is a build tool that will automatically download all the dependencies required for the project source and apply them in classpath accordingly.
You might have to install maven first. You can download that from here.

Eclipse plugin installation from Project File

I want to install eclipse plugin Agilereview from following link:
https://github.com/AgileReview-Project/AgileReview-EclipsePlugin
I downloaded the zip and unzipped it. I added it in eclipse as project and many projects added into workspace. When I tried to select all those projects and export them as deploy-able plugins in eclipse repository, eclipse doesn't allow it and always show error like plugin file missing. A problem is the zip file include many folders and many of those folder has its own plugin.xml file. Therefore, I think this Agilereview plugin itself is a combination of many plugins. I am sure that plugin is okay and its my mistake to install it.
Can anyone tell me, what is the mistake I am doing while installation? I want to install this plugin manually since later I need to optimize it.
Each of the folders org.agilereview.xxx is a separate Eclipse project. So you should use 'Import > Existing Projects into Workspace' to import these projects.
Since there are pom.xml files it looks like you should use maven and tycho to build the code.
For building RCP applications and plugins like Agilereview, which itself is a combination of many projects, you can check out the following tutorial:
http://www.vogella.com/tutorials/EclipseTycho/article.html
Eclipsetycho provides support for building eclipse components.
Install the maven eclipse tool, which will make your work easy.
http://download.eclipse.org/technology/m2e/releases
This is a pretty complex process, so spend some time to learn from the tutorial.

How do I tell the netbeans gradle plugin to add generated source files to Source Packages?

I would like to use gradle to automatically generate antlr4 source files from their grammars. This gradle template does most of the work. What is missing is adding the generated source folder to netbeans so it doesn't class not found errors in the editor. The template has plugin for IDEA IntelliJ, so I tried to see if something similar was possible with netbeans, but haven't been able to find anything. I looked at the netbeans gradle plugin, but couldn't see away to do it.
Does anyone know how to modify what Netbeans' gradle plugin reads as source files?
I found the answer and it's odd. If you use the template with the IDEA plugin left in, the generated source code is added to Source Packages in netbeans. There is nothing to configure. It just works. It seems some of the IDEA plugin functionality is generic.

Add Java Libraries to Eclipse

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

Categories

Resources