How to import&edit Jmeter jar file/jar plugin in eclipse - java

I'm trying to import jar file ( which is a plugin for jmeter-i would like to edit it and again i want to jar it in eclipse ) in eclipse to see the source code of it.But im not able to see the source code of the jar file.
Can anyone help me how can i decompile a jar and make it editable in eclipse.
i decompiled online and used it in eclipse but eclipse is throwing number of errors.
By using jd decompiler i can view the .class of it .but i would like to edit the jar file according to my requirements.

From comments you need Jmeter InfluxDB Plugin.
Download source code and uzip it.
Apply your fixes and use gradle to build the jar in Eclipse.

Related

Program works in eclipse with libraries but not when extracted to jar

I've made a project in Java using Eclipse using the jnetpcap library which needs WinPCap to be installed to work properly. However, there's no winpcap library included in my project only jnetpcap. But when i extract the project into a generated jar with libraries, or with the libraries in a different folder, it somehow doesn't work. Why does everything work when i run the program from eclipse, but not as an extracted project?
Thanks in advance.
I faced the same issue few years back. Jnetpcap for eclipse comes with winpcap. You need to export your project on eclipse as runnable jar. There you have an option to select which says extract required libraries in the generated jar. In this way, the all the dependent libraries will be included in the exported runnable jar file.
The links below are some of the helpful links:
Create runnable jar in eclipse
Visit the post on winpcap website jnetpcap: a java wrapper for libpcap and winpcap
Does this thread helps you out? I would guess that you have not wrapped your dependency into the .jar file but only in eclipse. That is why it works inside your IDE.
You didn't declare your main class for the jar file.
Right click on your solution in eclipse->Run as-> Run configuration -> Main class -> choose you main class.
Now build your jar from the beginning and try to execute it.

Eclipse export libraries with non jar files

I'm facing a problem I have never had before when exporting my eclipse project with external library. I made a little program with spelling correction and I used the language tool library you can find here.
I put this library in the build path and correctly imported into my eclipse project. When I ask to export it into a runnable jar, Eclipse exports only the jar files into languageTool library, but this library contains also some txt and xml files. So when I try to launch the application from command line it gives me error because can't find this txt and xml files. I tried to add to my jar archive manually but obviously it doesn't work. How can I fix it?
Thanks for your time and forgive me for my bad english.

Viewing source code from a third-party jar in Eclipse

I am working on a Java project in Eclipse. In this I am using a third party JAR which I have put in on the classpath. Now I want to understand the code in the JAR file and want to see the actual code and navigate through the third party code just like my own code.
My question is this: Instead of me manually decompiling all of the class files in the JAR and putting them in the appropriate folder as per package declaration, is there some way in which Eclipse will decompile them for me, and put them in the appropriate folder? What should be the approach taken in such a scenario?
The decompiler I use is JAD. It has an eclipse plugin, Jadclipse.
You can download JAD from http://www.varaneckas.com/jad
You can get Jadclipse from http://sourceforge.net/projects/jadclipse/. Click on the download jar and then simply copy the jar into your Eclipse/plugins directory, and restart Eclipse. Set up the path to JAD from Preferences->Java->JADClipse. Then trying to view a class should give the decompiled code.
I have been using Java Decompiler for some time and have found it very useful, i don't know about eclipse but it seems to have a eclipse plugin: JD-Eclipse

Problem while setting jad with Eclipse Helios

I am using jad to decompile my java class files through Eclipse. I have installed net.sf.jadclipse_3.3.0.jar plugin for Eclipse
I put the jar in the Eclipse plugins directory.
Next I have downloaded the jad windows plugin (jadretro-win32-x86-jcgo) for my Windows 7.
Next I have started Eclipse and provided the path for the jadretro.exe in Eclipse.
But when i am trying to decompile my class files, its showing the error message -:
/jadclipse/
//Error!
Can someone please help ? I am using Eclipse Helios.
i hope you are not trying to view your class files (for which you have the source code). Jad throws the error
/Jadclipse/
//Error!
Pls try to view an OOTB jar or an imported jar
I guess, you should specify the path to jad.exe instead.

Java: edit and recompile .jar?

I downloaded JGraphT, and I want to make some changes to the core files. I'm using Eclipse. It wants a .jar or .zip to attach source files to the .class file. I have the .java file, but I'm not sure what I should do. Do I edit it, then recompile the jar?
I would start by going to the Sourceforge Developer tab for JGraphT, and follow the instructions on checking out the latest source code :
svn co https://jgrapht.svn.sourceforge.net/svnroot/jgrapht jgrapht
Then create a project in Eclipse from the sources, and read through the README on how to build and deploy.

Categories

Resources