Wednesday, April 30, 2014

Wednesday, April 16, 2014

Writing git log output to a file

Example:
$ git log --since="04/07/2014 20:37:53" --no-merges  > C:\test.log

It will write generated git log from the specified date and time without including merges to a test.log file.

Monday, April 7, 2014

Creating an executable JAR file for SWT Plug-in - Runnable JAR

You would have developed a small utility application, and now you wanted to create an executable JAR for that application.
Basically, end user should be able to launch the application by just double clicking on that.

Eclipse provides an option called “Runnable JAR” in the export menu items to perform this.






This will generate Plugin_Refactor_x86_1.0.jar file, including with all the required swt jars. 

Since swt native jars will be platform specific, we need to generate 32 bit or 64 bit files separately.

How to check Installed Java is a 32 bit or 64 bit version ?


If you have installed JDK, Java would have registered in the system environment variables.

Go to command prompt and type “java –version”

C:\Users\kh1205>java -version
 java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

If it’s a 64 bit Java, you will be finding “64-Bit Server VM” in the above line.

If it’s a 32 bit java, you will be finding “Client VM” in the above line.

I have another JDK configured in my system, for which I wanted to check java version.
For example, other version of java is available in the location “C:\Program Files (x86)\Java\jdk1.6.0_31

C:\Program Files (x86)\Java\jdk1.6.0_31\bin>java -version
 java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)


“Client VM” in the last line tell you that,  JDK is a 32 bit version.