Tuesday, November 26, 2013

Eclipse Mac: Cocoa SWT

Recently I started working on Mac eclipse, and i was trying to understand what is the underlying SWT library.

They are using Cocoa SWT.

Cocoa is Apple's native object-oriented application programming interface (API) for the OS X operating system.

More @ http://en.wikipedia.org/wiki/Cocoa_(API)


SWT will have 2 plugins:

org.eclipse.swt  => swt core plugin
org.eclipse.swt.cocoa.macosx => Native interface calls to Mac OS X


Seems to be cocoa is supported from eclipse 3.5 version
More @ http://www.eclipse.org/swt/cocoaport.php

Download @ http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.3-201306052000/swt-4.3-cocoa-macosx.zip

Android SDK tools Windows registry keys

Below are the keys registered in windows registry, if you have installed through android sdk exe file.

For 32 bit machines
HKEY_LOCAL_MACHINE\Software\Android SDK Tools

For 64 bit machines
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Android SDK Tools




Eclipse Plugin spy for menu items

All we know that (Alt+shift+F1) is used to identify the class which is used in the eclipse workbench based on the active selection.

I recently realized that, (Alt+shift+F2) can be used with menu items.
Press Alt+shift+F2, then click on menu item that you want to identify.

Download from @ http://www.eclipse.org/pde/incubator/spy/

Opening eclipse in debug console mode


1.        If you have specified java in in vm arguments, modify javaw.exe to java.exe
Javaw.exe is a window process
Java.exe is a console process

-vm
C:/KK/jdk1.6.0_32/bin/java.exe

Eclipse by default make use of javaw.exe process.

2.       You can find directly eclipsec.exe in your eclipse folder, this will open up a console to print all console level messages. By default this will invoke java.exe process.

To get the debug statements, add –debug parameter in the command prompt.

Example:
Ø  eclipsec –debug

     You can also try this.
Ø  eclipse –debug -consolelog

To understand more about java.exe and javaw.exe @ http://javapapers.com/core-java/java-vs-javaw-vs-javaws/






Friday, November 22, 2013

E325: ATTENTION Found a swap file by the name ".git/.MERGE_MSG.swp"

I was facing this issue while pulling the code from the git central server.

Basically error says, 2 things.

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r .git/MERGE_MSG"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".git/.MERGE_MSG.swp"
    to avoid this message.



I have verified (1), could not find any other terminal which was accessing this file.

I am not sure about (2), so I went ahead and deleted directly '.git/.MERGE_MSG.swp' file.

Yes, Now it worked without any issues!!!



Thursday, November 14, 2013

Ampersand (&) is not shown on tooltips in Eclipse

To show '&' as part of tooltip information, You need to follow the rules of doubling an ampersand when you want a single ampersand for tool tip text.  All platforms follow this rule and strip out the underscore.

Example:
String tooltip = "Hello & World"; => Hello && World"

Look at the code below.

import org.eclipse.jface.window.DefaultToolTip;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;


public class MyToolTip extends DefaultToolTip {

public MyToolTip(Control control) {
super(control);
}

@Override
protected String getText(Event event) {
int x = event.x;
int y = event.y;

String tooltip = "Hello & World"; //only for test
//TODO: build tooltip info here.
if (tooltip.contains("&")) {
tooltip = tooltip.replace("&", "&&"); //without double ampersand replacement tooltip info will be shown as 'Hello _World' by replacing & by _.
}
return tooltip;
}
}

Wednesday, November 13, 2013

Cloud Computing - IAAS,PAAS and SAAS


http://www.rackspace.com/knowledge_center/whitepaper/understanding-the-cloud-computing-stack-saas-paas-iaas

In simple terms:
SaaS (Software as a Serviceapplications are designed for end-users, delivered over the web 
PaaS (Platform as a Service) is the set of tools and services designed to make coding and deploying those applications quick and efficient 
IaaS (Instrastructure as a Service) is the hardware and software that powers it all – servers, storage, networks, operating systems

Friday, November 8, 2013

New to JavaScript - Tryout Google chrome + F12 = JavaScript Console

If you are a beginner, and want to try out some Java script code , you can think of Google Java script console. This comes with Google chrome browser.


Just press F12 to launch in js console.

New to Mac - Shortcut key for Sleep

To do this, head to System Preferences > Security & Privacy > General. Check the box next to “Require Password”.

Find the screenshot below for this.




Now, you can make use of below keys.
Command + Option + Eject (On the top right corner button in macBook pro).
Command + Option + Power (Power button).


I am a beginner for Mac system, so I am trying to post my learnings and experience with it!!!

Wednesday, November 6, 2013

SAP JCo libraries for Mac OS

SAP JCo(Java Connectors) libraries would be required to connect to the SAP server.  Basically it will have sap JCo ‘jar’ file as well as sap JCo native library file.
For example. If you are connecting using JCo3 jars, below would be required based on the operating system.
§  sapjco3.jar: JCo Java runtime libraries – This would be same for 32 bit and 64 bit systems
§  [prefix]sapjco3.[extension]: JNI runtime library that contains JCo native code. The target operating system determines the prefix and file name extension:
§  Windows: sapjco3.dll
§  MacOS: libsapjco3.jnilib

Note: Ensure that the libraries you use are correct for your 32-bit or 64-bit system.
.


Navigation view scrollbar is not visible in Eclipse Mac OS but visible in windows OS

Have you ever encountered an issue with scrollbars in eclipse, especially in navigation views or application views, which is visible in windows or but does not appear in Mac OS system.

Then reason could be with the Mac system preferences. Please follow below steps to enable the scrollbar in Mac.

1. Go to Mac Menu( Apple icon), you will find this in the top left corner of the system.
2. Click on 'System Preferences'.
3. Click on 'General' item from the ‘Personal’ section.
4. You can find 'Show scroll bars’ section.
5. Select ' Always' radio button.

This will enable the scrollbar in the navigation view, without this option also scrollbar will be there, just that you will not be able to realize that there is a scrollbar unless you start dragging in navigation view.


Please find the screenshot for system preferences configuration.


New to Mac - Print screen shorcuts

Command+Shift+3: Takes a screenshot of the full screen (or screens if multiple monitors), and save it as a file to the desktop

Command+Shift+4: Brings up a selection box so you can specify an area to take a screenshot of, then save it as a file to the desktop

Command+Shift+4, then spacebar, then click a window: Takes a screenshot of a window only and saves it as a file to the deskto

Tuesday, November 5, 2013

Java was started by returned exit code=1

Possible causes include:  The eclipse.ini configuration, wrong JAVA version, incorrect or corrupted JAVA installation and incompatibility between an eclipse plugin and the JAVA version.

Following are some links that list some of the causes and possible solutions for this error:

1.  Add the command -XX:-UseCompressedOops  at the end of the eclipse.ini file.  See the following link where this action is reported to resolve this issue:

http://www.eclipse.org/forums/index.php/m/653614/#msg_653614

2.  Remove and reinstall both the JAVA JDK and JRE.  See the following link where this action is reported to resolve this issue:

http://anmolanand.wordpress.com/2011/06/19/eclipse-java-was-started-but-returned-exit-code-1/

3.  Check to make sure that a JAVA update did not cause the error.  See the following links where a JAVA update is reported to have caused the issue:

http://www.coderanch.com/t/503269/vc/Eclipse-start-but-return-exit

http://stackoverflow.com/questions/4587518/eclipse-error-on-startup-windows-7

4.  Some eclipse plugin may not be compatible with the installed JAVA version.  See the following link where this situation is reported to have caused the issue:

http://www.eclipse.org/forums/index.php/t/266786/

Java/Eclipse Source code download

Any jar files source code
http://grepcode.com/

Eclipse related: SWT, JFace, etc..
http://archive.eclipse.org/eclipse/downloads/

Any Java related jars:
http://www.java2s.com/