Thursday, June 26, 2008

Fixing Eclipse Ganymede Startup Problems

If by chance, you are like me, and the first time that you ran Eclipse Ganymede, you were greeted with an exception screen like this one:



Here are the steps necessary to resolve that issue:

1.) Navigate to your $ECLIPSE_HOME directory (the directory where you installed Eclipse)
2.) Copy your eclipse.ini file, for backup purposes
3.) Open your eclipse.ini file and modify it to look similar to this:




4.) Try to start up Eclipse again, and hopefully your problem should be solved

The main problem seems to be that the initial settings does not allocate enough memory for Eclipse to run. By adjusting the memory settings, by using the example eclipse.ini file that I have shown, you are giving Eclipse enough memory to start up.

This interesting thing is that this issue does not seem to affect all installations. The "vanilla" Eclipse Ganymede that I obtained from Eclipse worked on one of my machines, but not on another.

If this helps, please pay it forward.

Thanks

Wednesday, June 25, 2008

Eclipse Ganymede Released Today

Well, the the Eclipse Community has done it again. Today is the day that they will be releasing their annual simultaneous release of the Eclipse Platform. Sticking with the moons of Jupiter, this year's simultaneous release, code named Ganymede, will include 23 seperate projects - not that you have to download and use all 23 projects, it is just that you can be assured that these projects are compatible with each other.

One of the biggest features / enhancements to the Eclipse Platform is the introduction of P2. P2 is the new provisioning platform that is used to manage OSGi bundles / Eclipse plugins, and the replacement for the Update Manager. There has been a lot of discussion with varying views on P2 - some in favor, others not.

I have not used it enough to form an official opinion, but at first glance I can say that the Update Manager was narrowly scoped in that it's purpose was really surrounding Eclipse Plugins. The idea of p2 is to not only be used to manage Eclipse Plugins, but also to manage OSGi bundles as a whole, which means that it can be used for any OSGi based application. I am also interested in trying their bundle pooling approach to managing Eclipse plugins versus the extension location approach, which I have been using up until now.

Here is information on how to Get Started with p2.

Here is where you will be able to download Eclipse Ganymede...as soon as the link is enabled.

Happy Coding!!!

Monday, June 16, 2008

Firefox 3 Download Day

The Mozilla Foundation has declared tomorrow, June 17th 2008, as Download Day. In an attempt to set a Guiness World Record for software downloads, they are encouraging everyone to participate by downloading Firefox 3 tomorrow.

I have been a fan of the Firefox Browser for a number of years now, however I will admit, that only recently have I started using their latest release candidate. This is because there are some add ons in Firefox, that I just cannot live without. Thankfully, the following add ons are now available and supported for the Firefox 3 platform:

Delicious BookMarks
If you are not familiar with the social networking site del.icio.us, it is a site that you can set and share bookmarks. By creating bookmarks and tagging them, those bookmarks become searchable by the social community. This is a great, but I really use it to keep my bookmarks in sync with the many computers that I work on. With this add on, you can log into your del.icio.us account, and use your bookmarks in Firefox.

FireGestures
In my view, Mouse Gestures is another one of those productivity boosters that is great to have in your arsenal. Instead of relying on clicking different buttons in the toolbar or using the Menu system in Firefox, you can simply use the mouse, and wave it across the screen while holding down the right click button, and Firefox will do your bidding. This is one of those features that I often take for granted on my machine, and expect to be available on others. I am disappointed often when I try to perform a Mouse Gesture, only to be greeted with the Context Menu that comes up when you right click on a web page.

Good luck Mozilla Foundation in breaking that Guiness World Record. You can count on my support.

Friday, May 2, 2008

Eclipse Hack :- Change the Splash Screen

Hey everyone,

Inspired by a recent posting on Planet Eclipse, I thought that I would share with you a hack that I have used to change the splash screen that is used when Eclipse starts. Enjoy.

Changing the Splash Screen:
1.) Navigate to the directory where you installed Eclipse, which I will now refer to as $ECLIPSE_HOME
2.) Move to the following directory $ECLIPSE_HOME/plugins/org.eclipse.platform_xxxxxx
3.) There you will find a file called splash.bmp
4.) Rename this file to splash.bmp.bak in order to keep the original file.
5.) Create your new bitmap file and place it in this directory as splash.bmp

And that is all there is to it.

Note: I am currently using eclipse-rcp-europa-winter-win32, so the directory on my machine that contains the splash.bmp file is org.eclipse.platform_3.3.3.r33x_r20080129. If you are using a different version of Eclipse, it may be something different, but it should at least start with the org.eclipse.platform.

Enjoy.

Thursday, February 14, 2008

Maven Archetype Upgraded

Finally, it is here. An upgraded of the Maven plugin, archetype, was just recently released. Well, according to JIRA, it was actually released last week, but just recently have I taken notice :).

One of the slams that Maven receives is related to the verbosity necessary in order to use the Archetype plugin to create new projects. In order to create a new simple java project using the older version of the Maven Archetype plugin, you had to do something similar to the following:

mvn archetype:create "-DgroupId=com.sagetech.example" "-DartifactId=dummyProject"

The above would create a simple project with the jar packaging type. If you wanted to do something a little more complex, like create a project of a different packaging type, (ejb, ear, web module), you had to specify even more properties to the archetype plugin, something similar to...

mvn archetype:create "-DgroupId=com.sagetech.example" "-DartifactId=dummyProjectWeb"
"-DarchetypeArtifactId="

Although the above approaches work without any issues, it still seemed to be a cold way for a developer to get started with an application. And it appears that I am not the only one who thought so.

With the recent release of the Archetype plugin, you don't have to specify any properties at all. Simply type the command:

mvn archetype:generate

...and during the course of the execution of the plugin, it will prompt you for the following information:

1.) Choose the archetype
2.) Choose the groupId
3.) Define the artifactId
4.) Define the version
5.) Define the package

A friend of mine has always given me a hard time about how verbose you have to be in order to create a java application using the Maven Archetype Plugin. I cannot wait until he reads this post...Dave Brondsema, this one is for you.... :)

Using Groovy...

In one of my earlier posts, I mentioned that I have really enjoyed my journey into Groovy, because I have been able to leverage it's power practically on the job. For this post, I wanted to give you a practical example of how I have been able to do just that.

I currently deal with large quantities of data. So much, in fact, that our project has stored procedures that will truncate tables because there is not enough tablespace in order to handle delete queries. This works fine if I want to delete all the records in a table, but what if I only want to delete a subset, let's say 50,000 of the multiple million records? With groovy, and it's built in SQL functionality, this becomes very easy to accomplish. Here is the complete program:


import groovy.sql.Sql

def sql = Sql.newInstance("${jdbc.url}", "${jdbc.userId}", "${jdbc.password}", "${jdbc.driver})
def query = "select customer_id from customer where customer_group_id = 11020"
sql.eachRow(query as String, {row -> sql.execute("delete from customer where customer_id = ?", [row.CUSTOMER_ID])})


The Sql object represents the connection to the database. The first thing we do is open the connection to the database using the newInstance method which takes in a valid jdbc url, db user id, db password, and jdbc driver.

Note: The JDBC Driver must exist on the classpath when executing this script.

The query variable holds the sql statement that will return me all of the id's of the customers that I would like to delete from the customer table.

Using the eachRow method on the Sql object, as each row is returned, I execute the anonymous in line closure...


{row -> sql.execute("delete from customer where customer_id = ?", [row.CUSTOMER_ID])}


Which will execute a delete statement for each record returned from the original query.

Running the application is just as simple as well...

groovy -cp .\lib\<> deleteCustomers.groovy


This is one of the many uses that I have found for this simple, yet powerful dynamic language. I hope to share more with you in the future.

Enjoy.

Tuesday, February 12, 2008

This year will be Groovy

One of the things that I wanted to accomplish this year, was to learn a new programming language. There are so many different languages that now are able to run on the JVM, that I didn't know exactly where I would focus my attention.

Originally, I started out with the idea that I wanted to learn Scala. One of the main reasons why I wanted to learn Scala is because it is a functional language. I have never worked with a functional language before. I was interested to see if solving problems in a functional manner, would inspire me to approach problems in Java differently. I downloaded it and started to go to the different tutorials online. To be honest, I was a little intimidated. The syntax is very different, and I don't think that I would be able to spend the amount of time necessary in order to get up to speed with this language.

The next language that I considered learning was JRuby. Of course, everyone has heard all of the hype around Ruby. However, I was more interested in learning more about JRuby because I have a ton of Java code / experience that I didn't want to lay waste. With JRuby, it is possible to use all of the fun Ruby syntax, but not have to give up your Java code / experience. Ultimately, I decided not to spend time looking into this language either. I think that I am still interested in picking this up in the future, but now I am even more interested in....

Groovy. I like Groovy. I like Groovy, a lot. One of the main reasons why I like Groovy so much, is because I have just started using it, and already I have been able to apply it to solve real customer requirements. We had a need to generate XML files based off of a Database query. Now, you can imagine how much Java code would be necessary in order to accomplish such a feat. By leveraging Groovy's integrated Sql features together with their Template approach, I was able to solve the problem very easily.

Another reason why I enjoy this language so much is because it was built with integration with Java in mind. If you cannot think of a Groovy way to get a task done, you can always import a Java class and use it. I didn't know the best way to format a Date in Groovy. However, in Java, I know that I can use the SimpleDateFormat. So that is what I did. I imported it at the top of my Groovy script, and used it. Simple.

What are you learning new this year?