![]()
What if you have to decompile a huge jar file (like weblogic.jar) to debug a nasty issue? for a lot of closed source binary the source code is not always available, in this small post I will show you how to automate the de-compilation of java classes with a bit of bash magic.
First you’ll have to get the JAD decompiler if you don’t already have this tool in your development toolbox
wget www.varaneckas.com/sites/default/files/jad/jad158e.linux.static.zip unzip jad158e.linux.static.zip
Unpack and decompile all class found in the jar file, replace the file weblogic.jar with any other jar file
jar -xf weblogic.jar && find . -iname "*.class" | xargs /path.to/jad -r
Delete all files *.class from the current directory recursively
find . -type f -name *.class -exec rm {} \;
And rename all decompile .jad files to .java
find -name *.jad -exec rename 's/\.jad$/\.java/' {} \;
You can now repack the whole directory into a zip that you may deploy in your local maven repository or attached to weblogic.jar as source code in eclipse. I now just have to wish you good luck and happy debugging sessions!
I’ve been granted a free professional license of XDepend, thanks to Mat Huston, XDepend lead developer.
XDepend is a static analysis tool for JAVA developers that provides 82 code metrics, several real-time code visualization panels, code base snapshots comparison, architectural and quality rules (edition and real-time validation). The tool is a frontend to support the Code Query Language (CQL) to query a code base the same way you would query a relational database. You can using CQL, write and design your own rules and conventions for your code base.
- Analyses your java byte code, your test reports and your source files to extract structural information and 82 base metrics via static analysis.
- Provides complementary and interactive views on the same information. A Tree-Map view helps you easily identify the big one from the small one. The dependency matrix, the graph view and the detailed view help you gain insight in your code base.
- Has a Code Query Language (CQL) is a specific XDepend language, very similar to SQL, that helps you dynamically find what you are looking for.
What is also interesting me a lot is the possibility to make XDepend part of the Maven lifecycle, but that will be part of a new post. For now I am trying to understand the added value on our company software solution Innoveo Skye®
More to come later
Note: .Net is also having a similar tools NDepend, build on the same engine developed by Patrick Smacchia.
Tux Droid is a Linux wireless Tux mascot (210mm x 180mm x 140mm - with lowered wings) with a programmable interface, allowing it to announce events by its gestures and by ALSA driven sound. The events are detected by specific gadgets, which are handled by the Tux Gadget Manager. The Tux Droid supports Linux kernel 2.4 or later and needs a 800 MHz CPU and 128 MB RAM. It communicates by infrared to the USB port (1.1 or 2.0) and for media detection it needs an internet connection. The mascot is driven by Atmel AVR RISC microcontrollers. From http://en.wikipedia.org/wiki/Tux_Droid
TeamCity is a Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper.
Tux Droid is a Linux wireless Tux mascot (210mm x 180mm x 140mm - with lowered wings) with a programmable interface, allowing it to announce events by its gestures and by ALSA driven sound. The events are detected by specific gadgets, which are handled by the Tux Gadget Manager. The Tux Droid supports Linux kernel 2.4 or later and needs a 800 MHz CPU and 128 MB RAM. It communicates by infrared to the USB port (1.1 or 2.0) and for media detection it needs an internet connection. The mascot is driven by Atmel AVR RISC microcontrollers. From http://en.wikipedia.org/wiki/Tux_Droid
Bamboo is a continuous integration server from Atlassian Software Systems, the makers of JIRA, Confluence and Crowd. Bamboo is free for philanthropic and open-source projects. Academic and commercial organizations are charged based on type of license. Some other features of Bamboo are its unlimited build plans and unlimited projects that provide instant feedback and a platform to collaborate with other team members for build projects, and its ability to run distributed builds. It integrates with existing development tools, and it can be integrated with popular source code systems.
With this plugin
You can notify your Tux Droid with your TeamCity build results!
After login you can find the new notificator Tux Droid in your notification settings. You need your Tux Droid server IP and port to connect your Tux to Bamboo. After you have saved the parameters you can configure your individual notification settings for just all projects/specific projects/build failures/...
Each registered User can customize Tux Droid messages or choose different Attitunes.
Some useful resource how to develop a Bamboo plugin with Maven 2
Plugin will appear soon at
http://tuxdroid-bamboo.waltercedric.com/
Note you may be interested by the TeamCity continuous integration server version at http://tuxdroid.waltercedric.com/
These tools are highly recommended across a team of different developers for the following reasons:
They give an immediate "objective" feedback and help developers recognize where they have been excellent or lazy;
It gives team leader, an opportunity to study the code, design and team from a different perspective; and by slicing off
whole classes of faults, You can concentrate more on design shortcomings.
Read more: Using Code Checker to improve your Java code (Part 1)
Privacy Statement | Copyright Notice | Licenses
© 1999-2012 Waltercedric.com. Designed by Cédric Walter. Sitemap
Reproduction without explicit permission is prohibited. All Rights Reserved. All photos remain copyright © their rightful owners. No copyright infringement is intended.
Disclaimer: The editor(s) reserve the right to edit any comments that are found to be abusive, offensive, contain profanity, serves as spam, is largely self-promotional, or displaying attempts to harbour irrelevant text links for any purpose.