Wednesday, February 22, 2012

Small Technique on using Java Decompiler in Eclipse

Here's my common use way on the Java Decompiler..

Method 1: Direct Access to the class by shortcut
1. Click Ctrl + T, and then input the class and input the class name

2. Eclipse will bring you to the class implementation.


Method 2: Direct Access to the class by Open Declaration (F3)
1. Mouse over to the corresponding class in the Java File and click F3
For example, mouse over javax.ejb.SessionBean and then  click F3


2. Eclipse will bring you to the class implementation.





Method 3: Use Java Browsing Perspective
1. Click the icon in the Red Box below to Open a new perspective


 2. Choose Java Browsing

3. You may find your class implementation as below.

Monday, February 20, 2012

Install Decompiler in Eclipse Indgio

This article will show you how to install a Java Decompiler to Eclipse.. We will use JadClipse in this example. 

  JadClipse
Maintainer:Vladimir Grishchenko, Johann Gyger
Platform:Platform independent
Genre:Java, Decompiler, Eclipse plug-in
License:CPL
Languages:English, Russian
Website:JadClipse.sf.net
 
1. Download JAD

http://www.softpedia.com/progDownload/JAD-Download-85911.html

2. Download JADEclipse in sourceforge


http://sourceforge.net/projects/jadclipse/

3. Put the JAR to Eclipse Plugin Folder
For example: D:\eclipse_indigo\plugins\net.sf.jadclipse_3.3.0.jar


4. Start and Configure Eclipse for the JAD Plugin
In Eclipse, Click Window –> Preference –> Java –> Jadclipse
For example: 
Path to decompiler: D:\warez\JAD\jadnt158\jad.exe
Directory for temporary files: D:\tmp\Decompiler


5. Done and test
Open a file, mouse over the javax.ejb.SessionBean, click F3 to go to the class definition.

 The Decompiled Java file will be shown.

Thursday, February 16, 2012

The project was not built due to "Could not delete 'XXXXXX'". Fix the problem, then try refreshing this project and building it since it may be inconsistent.

The project was not built due to  "Could not delete 'XXXXXX'". Fix the problem, then try refreshing this project and building it since it may be inconsistent.


This problem is due to the cache of the old class file in eclipse, to clean the cache..

1. Project -> Clean

2. Clean all projects

3. The error is gone.

How to avoid calling huge number of Java program

Background
When the mail server receive email, it would trigger a java program by calling a shell script.
However, as the volumne of email is large, the java program will be triggered serveral times...

Better Design

Wednesday, February 15, 2012

[Resolved] Do not use APIs from sun.* packages (WAS Upgrade)

This is a short note for my WAS upgrade project V6.0 to V7.0

Recommendation by the WebSphere Application Migration Tool:
Do not use APIs from sun.* packages

Package: sun.misc.BASE64Encoder

*** Code changes as below:

Before
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

Monday, February 13, 2012

[Resolved] Use the BigDecimal toPlainString() method explicitly when deriving a string value (WAS Upgrade)

This is a short note for my WAS upgrade project V6.0 to V7.0

Recommendation by the WebSphere Application Migration Tool:
Use the BigDecimal toPlainString() method explicitly when deriving a string value


The behavior of the method toString() in BigDecimal is changed from J2SE 1.4 to 1.5

Java 1.4.2

 StringtoString()
          Returns the string representation of this BigDecimal.