Remove obsolete workspaces from Eclipse Workspaces List

Writing by shivdev on Wednesday, 4 of January , 2012 at 6:40 pm

Sometimes you want to avoid clutter in your Eclipse Workspace Launcher and might want to remove obsolete workspaces.

Clean up the value for RECENT_WORKSPACES key, located in the org.eclipse.ui.ide.prefs file.

$ECLIPSE_HOME/configuration/.settings/org.eclipse.ui.ide.prefs

Restart eclipse and it should be gone.

Leave a comment

Category: Eclipse

How to stop Eclipse from trying to run XML files?

Writing by shivdev on Sunday, 30 of October , 2011 at 10:08 pm

Usually with Android development in Eclipse, you will often be working with XML Files and trying to mess with them. Now while testing your app you will find a file.out.xml that gets created that completely messes up the Android build and shows errors. One way to avoid this is to use the following Settings in Eclipse.

Window -> Preferences -> Run/Debug -> Launching -> Launch Operation -> Always launch the previously launched application

Leave a comment

Category: Android,Eclipse

Start Eclipse with a specific JVM

Writing by shivdev on Monday, 29 of August , 2011 at 9:44 pm

If you want to start eclipse with a specific version of Java, use the -vm option.

C:\eclipse\eclipse.exe -vm C:\jdk1.6.0_26\bin\javaw.exe

Leave a comment

Category: Eclipse

Creating JavaDoc for a one-off Java class

Writing by shivdev on Tuesday, 15 of February , 2011 at 9:48 pm

Sometimes you might want to create some JavaDoc for some APIs (as a one-off) say for a customer (Doc Team etc.). Simply use the javadoc command line option. Use the -d option to specify the destination for generated HTML content.

~/java/jdk1.6.0_20/bin/javadoc ./src/java/com/domain/api/MyService.java -d ~/tmp/javadoc

Alternatively, from within Eclipse – you can start the JavaDoc wizard and select the class you want generate the JavaDoc for.

File => Export => Java => JavaDoc => Select The Class, Desitination and hit Finish

Leave a comment

Category: Eclipse,Java

Java Remote Debug

Writing by shivdev on Thursday, 12 of August , 2010 at 4:45 pm

It’s easy to forget the options required to start a Java process with Remote Debug turned on at some port. So, to attach your Eclipse (or other IDE) debugger to a running Java process you need to start that process with the following Java options.

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5096

Start your Java process with these parameters. Then you can use your IDE to connect to this process.

For Eclipse,

  • In Eclipse, navigate to Run | Debug Configurations…
  • Create a new Remote Java Application (in the left column)
  • Fill in the required values and in the port enter 5096 and click Debug to attach to the process

Leave a comment

Category: Eclipse,Java

Eclipse open files in the Text Editor

Writing by shivdev on Tuesday, 10 of August , 2010 at 1:20 pm

Sometimes Eclipse opens *.sh (etc.) files in the default editor emacs, vi etc. or probably tries to execute them. To open them in the Default Eclipse Text Editor you need to set it up in the Eclipse preferences.

Window->Preferences->General->Editors->File Association
In the File types: section Add *.sh
In the Associated editor section Add Text Editor

Leave a comment

Category: Eclipse

Shivdev Kalambi's Blog

Shivdev Kalambi is a Principal Software Engineer working at ArcSight. He has over 11 years' experience in software development and has worked with several technologies and played different roles and contributed to all phases of projects. Other non-tech activies include Ping-pong, Racquetball, Rock Climbing at PG and Swimming.