12 November 2009

Grrr - What Happened to Java 1.5 on Snow Leopard?!



Just this week I updated to Mac OS X Snow Leopard (10.6.2) only to discover that it removes Java 1.5 entirely - WTF?! I have no idea why Java 1.5 was removed but it was a bad decision. How is it logical that Java 1.3 is reinstalled but Java 1.5 is removed? Anyway, after some searching and a bit of trial and error on my system, here are steps that I had to take to fix this situation:


  1. Download Java for Mac OS X 10.5 Update 4

  2. IMPORTANT!!! Make sure to run the following two commands BEFORE proceeding:

    1. sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.5

    2. sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0


    This removes the old Java 1.5 sym links to prevent the Java 1.6 directory from being overwritten (very bad)

  3. Using the Finder, locate the JavaForMacOSX10.5Update4.dmg file and double-click on it to mount the disk image

  4. Create a sym link to a missing utility:

    1. sudo ln -s /usr/bin/update_dyld_shared_cache /usr/bin/update_prebinding


    This command fixes a missing sym link in Snow Leopard that is needed by the Pacifist in the next step

  5. Using the Pacifist, open the JavaForMacOSX10.5Update4.pkg file from the mounted disk image

  6. In the Pacifist, navigate to /System/Library/Frameworks/JavaVM.framework/Versions and follow these steps:

    1. Right-click on 1.5 and select 'Install to Default Location'

    2. Right-click on 1.5.0 and select 'Install to Default Location'




After going through these steps, Java 1.5 should now be installed on the system. You can see this by listing the following:


$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/1.5
lrwxr-xr-x 1 bsnyder staff 5 Nov 12 13:47 /System/Library/Frameworks/JavaVM.framework/Versions/1.5 -> 1.5.0
$ ls -1 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/
Classes
Commands
Headers
Home
Libraries
Resources




NOTE: Through my travels, I've found that many people have no idea that you could switch between different versions of Java. To make the task of switching extremely easy, grab my friend David's setjdk script and use it to handle this task from the command line. It's a bash script that even supports tab completion. So once the script is set up in your environment, switching between versions of Java is as easy as running the following command to see the available Java versions:

$ setjdk <tab>

Then just choose the version you'd like to use, e.g.:

$ setjdk 1.5
Setting this terminal's JDK to 1.5 ... java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)


UPDATE: I had to use the steps above to reinstall the documentation for Java 1.5 as well. I found it in the Java for Mac OS X 10.5 Update 4 Developer Documentation. This placed the appledocs.jar, the doc.jar and the src.jar files into the /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home directory. Then I just expanded the doc.jar file to be able to browse the API docs for Java 1.5 via a browser.

20 June 2009

SpringSource University in Denver



On Tuesday morning I had just returned from a run at about 9:35am and was checking my messages before I showered and began working for the day. As I was reading various messages, dripping sweat and sipping on some water, I was pinged by my friend and colleague Filip Hanik on IRC. He told me that he was sitting in a classroom in Denver for the SpringSource University Core Spring Training. Here's how the conversation went:


Filip: hey
Bruce: hey, what's up?
Filip: sitting at Core Spring in Denver, but there is no trainer
Bruce: whoops
Bruce: sorry to hear that, is there anything I can do to help?
Filip: yeah, you can come down here and teach this course :)
Bruce: are you serious?
Filip: yes
Bruce: headed for the shower now, see you about 11


By 11am I was in Denver and teaching the first day of the course.

Lucky for me, Chris Beams, a stellar consultant/engineer/trainer at SpringSource, was en route to deliver the rest of the course. Chris arrived later Tuesday evening and taught the course for the rest of the week through Friday and I was lucky enough to sit in. Chris went the extra mile to arrive early and stay late for the rest of the week and even wound up finishing on time on Friday afternoon, a testament to his talents, for sure.

Using Maven? You Should Be Using m2eclipse



If you use Maven for your Java projects, then you should take a look at m2eclipse plugin for Eclipse. After all, there's now a whole book on m2eclipse instead of just a single chapter!

11 June 2009

Enterprise Integration Patterns in Practice at JavaOne 2009



Last week I was in San Francisco to speak at JavaOne 2009 to deliver a talk named Enterprise Integration Patterns in Practice where I co-presented with Andreas Egloff from Sun.

We talked about implementing EIP patterns using Apache Camel and Sun's Fuji. I used ActiveMQ in my demo which was rather short but worked well (yay! the demo gods smiled on me last week :-) ) and Andreas showed off Sun's web-based EIP editor. Although this editor looks very cool and Andreas showed how to edit scripting code in each component on the diagram, it left me wondering how it interfaces with Java code. After our demos, my laptop would not flip back to the presentation at the end (which presented an abrupt ending) but still we received a lot of complements throughout the rest of the week.

Beyond the talk, I got to see tons of friends who I don't see that often throughout the year including Debbie, Guillaume, Hiram and Rob, as well as many new SpringSource colleagues (since the acquisition of Hyperic). I also met many, many new folks including Colin and Jamie. I was also lucky enough to eat Thai food twice (love the yellow curry) and sushi once during the week - mmmmmmmmmmm.

If you would like a copy of the presentation, just drop me an email and I'll send it your way (bruce DOT snyder AT gmail DOT com). I'm not sure how much sense the slides will make without the delivery, but it seems like folks are always requesting my presentations after the fact.

12 May 2009

JeOS, Oracle XE and VMware on MacOS X

Last week I installed Ubuntu JeOS (Just Enough Operating System) on VMWare Fusion. JeOS is a slimmed-down version of Ubuntu specifically made for installation in a virtual machine so that it has a much smaller footprint than the normal Ubuntu distribution. Anyway, I did this so that I'd have a VM with a smaller footprint that I can use on my MacBook Pro for development and testing.

After setting up JeOS, I installed Oracle XE, a slimmed down version of Oracle that is free for development and distribution. I used these instructions for installing Oracle XE on Ubuntu but there were some catches, namely that by default the web application for Oracle XE was bound to the localhost, i.e., I couldn't see the web app from Firefox in MacOS X. This was easily remedied via this comment on a blog post about this very topic:

Set up the environment on JeOS to use sqlplus:


export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export PATH=${PATH}:${ORACLE_HOME}/bin


Now use the Oracle sqlplus command-line utility to alter a setting that disables local-only access to Apex. Below is the command to run:


$ sqlplus system@xe
Enter password: SYSTEM_password

SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);


Now that I could access the Apex webapp (http://127.0.0.1:8080/apex) that is installed with Oracle XE and I was able to use Apex create a user for myself. After this, I could access Oracle XE from MacOS X.

This setup has been working very well for me until today. For no apparent reason, the networking in JeOS went flaky and I could not access the outside world at all. I switched between NAT and host-only networking in VMWare multiple times, rebooting the VM each time - no dice. I upgraded to the latest VMWare Fusion - no dice. I could SSH into the VM from MacOS but that was it. No commands from JeOS would reach the outside world. So on a whim, I reran the vmware-install.pl script again and after that the networking seems to work again. I still have no idea why this happened which is a bit troubling. I don't want to just blindly keep running the install script again with no idea why it's fixing this networking issue.

Update

I guess the networking issue is common enough that Fusion provides a script to restart everything underneath of Fusion, e.g.:


/Library/Application\ Support/VMware\ Fusion/boot.sh --restart


Also, there's a good document available for Understanding Networking in VMware Fusion if you're interested. It's brief and to the point.

07 May 2009

SpringSource Tool Suite Now Available For FREE!



Last week in Amsterdam, at the SpringOne EU conference, it was announced that the SpringSource Tool Suite (STS) is now available for FREE! I was very pleased that we made this move as STS is an excellent set of Eclipse-based development tools that can make your Java development much more productive.

If you use Eclipse for your Java development and you use the Spring Framework, then you should really take STS for a spin. It's just like using the Eclipse you know and love but with many added features to make your development more productive. Download the SpringSource Tool Suite now!

I also saw many great talks at SpringOne EU that showcased STS via demos using it. Here is a partial list of some that I saw:



One of the demos that stands out in my mind was delivered by Adrian Colyer during his keynote on day two that utilized many technologies. But the thing I remember the most (and wish that I had more time to play with) was the use of the AWS Toolkit for Eclipse and Chris Richardson's Cloud Foundry, both for working with app deployment and monitoring in the cloud. The ease with which Adrian deployed apps to Amazon EC2 and was able to monitor them were amazing. I say it was amazing because I started working with Amazon EC2 from the command line before any such polished tools were available. It is really great to see the ever-increasing ease of working with cloud-based platforms. If you haven't checked out these two tools and you work with Amazon EC2, I highly encourage you to take some time to do so. Coupled with STS, they will make your life much, much easier.

I have to say it is very cool to see the products all come together like this. It's also awesome to watch demos delivered by folks who know each tool so well. It makes me wish that we had more face-to-face meetings so that I could sponge more of the product knowledge from folks!

03 April 2009

Apache ActiveMQ at SpringOne EU



Later this month I'll be in Amsterdam again, this time to speak at SpringOne EU about Apache ActiveMQ. It will be great to be back in Amsterdam, especially because the annual Queen's Day celebration takes place the week of the conference, which is always a fun time.

My first SpringOne conference was back in December in Florida and it was very good. Unfortunately I had a lot of travel booked back-to-back at the time so I wasn't able to be there for the entire conference. This time I will be able to spend the entire week at the conference which will be great because there are many sessions I'd like to see. Here are just a few:



There are many other talks I'd like to see, just too many to list. Take a look at the SpringOne EU schedule for the full list.