Tag Archives: Eclipse

Creating a Shortcut to Eclipse on the Ubuntu Unity Dock

If you use Eclipse on Ubuntu, you will probably have found that the version in the Ubuntu repositories doesn’t have all the plugins you’re used to, and will have installed Eclipse from a download at eclipse.org

If this is the case, you can create a shortcut launcher to Eclipse using the gnome-desktop-item-edit application enabling Eclipse to be pinned to the Unity Dock. gnome-desktop-item-edit isn’t installed with a clean copy of Ubuntu however. To install run the following:

$ sudo apt-get install gnome-panel

After installation, you can create a new launcher by executing the following command:

$ gnome-desktop-item-edit --create-new ~/.local/share/applications

This will cause the following window to be displayed.

Unity Launcher

Enter all the relevant details into the window (including selecting the icon) and press OK. This will create an Eclipse launcher. If you then navigate to this folder, you can drag and drop the Eclipse icon onto the Dock to create the pinned shortcut to Eclipse.

Using GlassFish from Eclipse

When I think of developing apps using GlassFish, I usually think of using NetBeans for the development. As you’d expect however, Oracle provides some good tooling to allow you to develop against GlassFish from within Eclipse – even to the point of installing the application server directly from within Eclipse.  So, how is this done?

Installing GlassFish Server Tools

Contrary to what you’d expect, to install GlassFish tooling, you don’t use the Eclipse Marketplace for installation.  To install, right click within the “Servers” pane and select “New | Server” to display the “Define a New Server” dialog. On this dialog, select “Download additional server adaptors” and in the resulting dialog select “Oracle GlassFish Server Tools”.GlassFish Server Tools

After accepting the licence conditions, the GlassFish Server tools will be downloaded upon which you’ll need to restart Eclipse to complete the installation.

Defining a GlassFish Instance

After a restart, opening the ”Define a New Server” dialog will show that GlassFish support has been added.

Define New Server

Choose the GlassFish server you wish to use and press the “Next” button.  On the resulting dialog, you can choose to locate an existing copy of GlassFish, or install an new instance via the “Install Server” button if you don’t already have GlassFish installed.

GlassFish Runtime

One point to note here is that, if you install a new instance of GlassFish, you may then need to browse through the install folder to locate the “glassfish” folder within.  You will see that this is necessary because the “Next>” button will be disabled as you’ve installed an instance of GlassFish, but not correctly identified its location to Eclipse.

When you’ve selected (and installed if necessary) a GlassFish instance, complete the wizard to define the admninistrator credentials of the server.

GlassFish Tools

After creating a GlassFish server instance in Eclipse, you can develop and test Java EE 6 applications against it.  The GlassFish tools provides additional support to assist in this.  For example, right clicking on the server in the “Servers” tab allows you to manage the server or get additional information or support.

GlassFish Tools

New wizards are also installed into Eclipse to assist when creating GlassFish facets such as JMS or JDBC resources as shown below.  These wizards are available on the standard “File | New | Other” dialog under the “GlassFish” folder.

GlassFish Facets

Eclipse – ‘Building workspace’ has encountered a problem

I’ve got a web project that uses some 3rd party JavaScript libraries.  Unfortunately whenever Eclipse (Indigo) builds the project, it gives an error “‘Building workspace’ has encountered a problem”.

Building Workspace has encountered a problem

The details of the error read:

Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘project’.
java.lang.NullPointerException

On first inspection, it looks as though the solution would be to edit the JavaScript validator preferences and make it a bit less verbose.  Unfortunately though, there doesn’t seem to be any options in Eclipse to do this.

One solution though appears to be to edit the project Builders (Right click on Project, select “Properties” | “Builders”) and un-tick the JavaScript Validator option.

When you do this, Eclipse complains that this is an advanced operation and may cause side effects, so it doesn’t feel like the correct way to progress to me.  Having said that, it does eliminate the problem and allows Eclipse to build the project without NPEs.

Has anyone else experienced this problem and have a workaround that doesn’t involve disabling the ‘JavaScript Validator’ Builder, or is this the best approach in this situation?

Running JBoss Tools in Eclipse 3.6, Helios

With the release of a new version of Eclipse, its natural to download it and start using it straight away. One of the main problems doing this however, is that plugins aren’t always guaranteed to work with the new version of Eclipse. This is the case with JBoss Tools.

Fortunately however, you can install the JBoss Tools nightly builds as these are now compatible with Eclipse Helios. The easiest way to install JBoss Tools Nightly on Helios is via the update center at:

http://downloads.jboss.org/jbosstools/nightly/trunk/

When I first attempted to install JBoss Tools on Helios though I got the following error:

An error occurred while installing the items

session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null –> [R]org.mozilla.xpcom 1.9.1.2a, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).

The artifact file for osgi.bundle,org.mozilla.xpcom,1.9.1.2a was not found.

Eclipse was complaining that xulrunner could not be found. Unfortunately this is not available for the 64-bit version of Eclipse on Windows, so the simple solution is to download the 32-bit version of Helios and use that instead. When I did this, JBoss Tools installed correctly with no problems.

According to Max Andersen, the JBoss Tools team are going to make installing xulrunner optional (at the expense of the visual page editor), in which case it would be possible to install on a 64-bit JVM.

Eclipse 3.2 – I don’t think so

With the recent release of Eclipse 3.2 and the Calisto release of 10 Eclipse projects, I thought I would give Eclipse a try.

I’ve not used Eclipse in anger since the 2.x days, however I’ve used it on an off since, but never for my main development. I decided to give Eclipse 3.2 a try on Mac OS (Intel) so my view is tainted by how it works on that particular OS. My comments may or may not be valid on other OS – I don’t know.

To try out Eclipse, I decided to write a few simple web apps – nothing too complicated, simply a few JSPs and JSF backing beans. The first problem I encountered was trying to get support for Glassfish inside Eclipse. There is a plugin availble for this, but this has to be downloaded and installed separately. This isn’t difficult, but a fiddle not the less.

After installing the plugin, I found there are issues with it. It doesn’t always start the server correctly, and nearly always says that it has failed to start the server. If you want a few seconds, sometimes the server is started though. Once I did manage to get the server started from inside Eclipse though, deployment of my application worked as expected. I know this is a bit of an unfair criticism of Eclipse, but if you want to do Java EE 5 development, then Glassfish is a good server to work with. Are there any plans to have “native” support for this in the IDE without having to load a plugin?

The next problem I got with Eclipse 3.2 was the dreaded Permgen error. I’ve not changed any of the memory settings within Eclipse and am using the default values (latest Apple Java 5 VM). Maybe that was my problem. Still, for a very small web app with only a handfull of classes and JSPs I wouldn’t expect to get any Permgen errors.

The final problem I noticed was screen corruption (possibly as a result of the Permgen errors), and also a lot of dialogs have green highlighted text at the bottom of them saying “Read Me Trim (bottom)”. Is this some kind of debug message?

I know there are a lot of Eclipse users out there and I really wanted to like this new version. Maybe its the types of applications I’m writing – Java EE 5 web apps – but Eclipse just doesn’t do it for me.

Sorry Eclipse, I’m going to keep using NetBeans and IntelliJ for now. Maybe I’ll try Eclipse again at version 4.