Go to the folder where the files that you want to use are, then double-click the folder to open it. You should see a list of the files in the window. Select your folder's contents. Doing so will open your files in Eclipse. The File drop-down menu will reappear.
Click Export…. It's near the bottom of the drop-down menu. Double-click Java. This option is near the top of the page. Click JAR file. It's below the Java item that you double-clicked.
It's at the bottom of the window. Select resources to export. Click the checkbox next to any unchecked resources that you want to package into your JAR file. You'll do this in the window at the top of the page. Skip this step if you chose to create a runnable JAR file.
Select a save location. Click Browse… , type in a name for your file, click a folder in which you want to save the JAR file, and click Save. Click Finish. Doing so will create your JAR file, though the compression process may take awhile. You should create a runnable jar. You can do this with an IDE like eclipse. MF file that specifies your main class. After that, you can simply run your runnable jar by double clicking. Not Helpful 7 Helpful 5.
Include your email address to get a message when this question is answered. Related wikiHows How to. How to. About This Article.
Written by:. Co-authors: Updated: December 16, Categories: Java. Article Summary X 1. Deutsch: JAR Dateien erstellen. Thanks to all authors for creating a page that has been read , times.
Is this article up to date? Cookies make wikiHow better. This is equivalent to renaming filename. This doesn't extract the source code. It extracts the compiled source code. It indeed does only extract. Drag and drop the jar for which you want the sources on the JAD. Hope this helps. V-rund Puro-hit 5, 9 9 gold badges 29 29 silver badges 50 50 bronze badges. I will be posting the link hosted on my website The version in the techieme link works beautifully, thank you!
After saving all sources, when I open the Java files, it shows all the lines as commented lines. Is there any setting to fix that? Kranthi Sama 1 1 gold badge 10 10 silver badges 26 26 bronze badges. Matthew Willis Matthew Willis Note that.
I know it's an old question Still thought it would help someone 1 Go to your jar file's folder. Note: I tested this in MAC, it works.
Hopefully it will work on windows too. JCodex, I'm doing a research project on the sentiment analysis tool "opinionfinder" and its jar does indeed contain both java AND class files.
I know it would usually contain only. Your solution will only extract. Seems JD-GUI is a multi-platform tool that actually decompiles the code and shows the source code for classes in all packages. I tried it and could get the source code in a second in MacOS. I have Java 8 installed. You can get it on jd. For a specific class file you can do java -jar procyon-decompiler Java Decompiler will open with all the package structure in a tree format.
Prags Prags 2, 2 2 gold badges 19 19 silver badges 36 36 bronze badges. AndroChef Java Decompiler produces very good code that you can use directly in your projects The only tool I know that can do it is Eclipse - if you add a jar to project classpath, you would be able to browse its classes with methods and properties using usual package explorer.
Jad is klunky and no longer maintained. I've switched to "Java Decompiler" , which has a slick UI and support for new language features. Every decompiler I've used, though, runs into code it doesn't successfully decompile. For those, it helps to understand the disassembled Java byte code produced by the standard JDK tool, javap.
Well, a jar-file is just a zip-file, so if you unzip it with your favorite unzipping utility , you get all the files inside. If you want to look inside the class files to see the methods, you'll need a tool for that.
For navigation on Jar-file level as a zip file I use 7zip which works very well, and allows seeing and editing entries which is great for trouble shooting. One way to do this is to open the perspective in "Package explorer".
Doing this you can see the structure of your jar with class details. For this check the library folder in your project using package explorer. My requirement was to view the content of a file like a property file inside the jar, without actually extracting the jar. If anyone reached this thread just like me, try this command -. This Jar Explorer is good enough. Supports three decompiler types: JD, Procyon and Fernflower. Allows to search files and duplicates in any java archive.
You can open them with most decompression utilities these days, then just get something like DJ Java Decompiler if you want to view the source. Bndtools provides a free JAR viewer plugin for Eclipse.
Add the Eclipse update site and install only the viewer. It is not the quickest way because you have to drag it into your eclipse first. But you will have full java class browsing, even with decompile enabled. I've set the default action in windows to "Open with WinZip".
This makes it easy to manage JARs as archives. Easiest way to view classes, methods, properties, etc. You could try JarSpy.
Your IDE should also support this. I use JarExplorer or JarVisualizer. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Viewing contents of a. Asked 13 years ago. Active 6 months ago. Viewed k times. Improve this question. Dani Dani 3, 4 4 gold badges 28 28 silver badges 36 36 bronze badges. KolobCanyon true, but they top rated answer was submitted the same day as this one was asked — Pranav A.
Add a comment. Active Oldest Votes. Improve this answer. Tom Hawtin - tackline Tom Hawtin - tackline k 30 30 gold badges silver badges bronze badges. HelloWorld — mPrinC.
0コメント