Monday, April 7, 2014

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.

Friday, March 28, 2014

Microsoft visio for UML

Microsoft visio supports UML diagrams.

  • Class diagram
  • Sequence diagram
  • Use Case diagram
  • Activity diagram
  • State diagram

Download trial version @ http://office.microsoft.com/en-in/visio/

You can download UML2.5 stencils @ http://www.softwarestencils.com/uml/index.html

Friday, March 14, 2014

Eclipse plugins debug tracing facility

Debugging eclipse dropins

If you are attempting to use dropins, but your bundles are not being found, first ensure org.eclipse.equinox.ds and org.eclipse.equinox.p2.reconciler.dropins are marked to auto-start.

You can check these in bundles.info file in eclipse "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info"

Search for an entries of org.eclipse.equinox.ds and org.eclipse.equinox.p2.reconciler.dropins

Example:
org.eclipse.equinox.ds,1.4.1.v20120926-201320,plugins/org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar,2,true

org.eclipse.equinox.p2.reconciler.dropins,1.1.200.v20120301-2145,plugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.200.v20120301-2145.jar,4,true

Mark both of them to true, if it's not set already.

Resolution errors with dropins are silently ignored. To enable useful logging messages, place the following tracing options in your .options file:

org.eclipse.equinox.p2.core/debug=true
org.eclipse.equinox.p2.core/reconciler=true

We can create this file in eclipse root directory with name .options and add above 2 lines in it.
eclipse/.options

And now run your eclipse in -debug -console mode.


Resources:
https://wiki.eclipse.org/Equinox/p2/Getting_Started

Eclipse bundles.info

What is bundles.info file in eclipse ?

The file bundles.info contains a list of all the plug-ins installed in the current system. On startup, all the plug-ins listed in this file are given to OSGi as the exact set of plug-ins to run with.

Where can i find this file in eclipse ?

You can find in eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info

eclipse/
   configuration/
     config.ini
     org.eclipse.equinox.simpleconfigurator/
       bundles.info
   dropins/
   features/
   p2/
   plugins/
   eclipse.exe
   eclipse.ini
   ...



Resources:
https://wiki.eclipse.org/Equinox/p2/Getting_Started

Wednesday, February 19, 2014

Identifying a deadlock in your application using JConsole

It's very simple!!  You need not setup anything for this. JPS and JConsole comes with JDK toolkit.

Step 1:
Got to command prompt and type 'jps' command. This will tell you the currently running java process id's.

Example:
C:\Users\kh1205>jps

7620 org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
7048 Main
5740 Jps


Step 2:
Open jconsole using your application process id, in my case 7048 is my eclipse application process id.

Example:
C:\Users\kh1205>jconsole 7048

This will launch jconsole window with various sections.

Step 3:
Navigate to Threads section in jconsole window, and navigate through main thread(ex:main) and worker threads(ex: worker-1, worker-2). In one of these threads, your application is in waiting state.





Tuesday, February 11, 2014

Ellipses (...) conventions in Eclipse

There are lot of discussions on this topic, but there is no official eclipse wiki page which described ellipses standards and conventions which has to be used while developing eclipse products.

Below are the resources which helps us to understand how to use ellipses in eclipse.


As per my understanding, eclipse is mostly following Windows User interface guidelines for ellipses usage conventions.

Below points which helps us to understand in summary.

1. Display an ellipsis if a dialog box is displayed to the user to change/enter information. Omit the ellipses for "show properties", "help" and "about" which are essentially "show" dialogs anyway. No more info is needed for them.

2. While command buttons are used for immediate actions, more information might be needed to perform the action. Indicate a command that needs additional information by adding an ellipsis at the end of the button label
Screen shot of Print command button with ellipses

In this example, the Print... command displays a Print dialog box to gather more information.
Screen shot of Print command button, no ellipses
By contrast, in this example the Print command prints a single copy of a document to the default printer without any further user interaction.

3. Proper use of ellipses is important to indicate that users can make further choices before performing the action, or even cancel the action entirely.

This doesn't mean you should use an ellipsis whenever an action displays another window—only when additional information is required to perform the action. Consequently, any command button whose implicit verb is to "show another window" doesn't take an ellipsis, such as with the commands About, Advanced, Help (or any other command linking to a Help topic), Options, Properties, or Settings.

4. Generally, ellipses are used in user interfaces to indicate incompleteness. Commands that show other windows aren't incomplete—they must display another window and additional information isn't needed to perform their action. 

    Some actions in Eclipse:
    Restart -> it will just restart without asking. It might ask if any unsaved changes, for confirmation ellipses not required.
    Exit -> It will just exit from the eclipse. No ellipse required

    Import...  -user has to select what has to imported. We should use ellipse here
    Export...  -user has to select what has to exported. We should use ellipse here