Coming Up for Air

Writing Pluggable Java EE Applications

Jason Lee 2012-07-09

/images/2012/07/jaxlogo.gif

I just finished giving my session at JAXConf San Francisco 2012, "Writing Plugged-In Java EE Apps". I think it went pretty well, though I guess I'll find out how it really went when the reviews come in. here is a tar ball that includes the code we looked at during the session, as well as the accompanying slides. Hopefully I'll be able to get this code put in a proper public repository (such as java.net or GitHub, or both) soon. For now, feel free to play with the code. Fix bugs. Extend it. Whatever comes to mind. :) If you make changes or use it in something, I'd love to hear about it. Thanks to all who attended!

Firefox, Linux, and the Java Plugin

Jason Lee 2012-06-20

/images/2012/06/java-plugin-300x284.png

In a perfect world, Firefox, Linux and the Java plugin would get along happily. You'd install all three, and things would just work. If memory serves, that's exactly what happened under Ubuntu. However, after installing Fedora 17, it just didn't want to work for me (I'm not blaming Fedora, mind you. I like to live on the bleeding edge, so I install Java 7 nightlies from tar balls and not RPMs, so I probably broke something along the way). After much fumbling and guessing, I finally found a solution, which I'll share here in case you're in the same boat:

$ mkdir $HOME/.mozilla/plugins
$ ln -s $PATH_TO_JRE/lib/amd64/libnpjp2.so $HOME/.mozilla/plugins/libnpjp2.so

And restart Firefox. You can verify that Java (i.e., applets and webstart) is working by going here .

From OS X to Linux

Jason Lee 2012-04-23

/images/2012/04/mac.jpg

When I joined Sun Microsystems "way back" in 2008, I was asked if I wanted a Mac for my work system. Having heard many extol the numerous virtues of the OS, I jumped at the chance. Since then, I've even migrated my wife and family to the OS. Trouble arose last fall, though, with the delivery of a new MacBook Pro (whose purchase was somewhat a miracle, brought about by the tireless efforts from my upper management). Simply put, I got a lemon. After five trips to the Apple Store, which resulted in overnight diagnostic runs; shipment to an offsite, more advanced repair facility; the replacement of the hard drive; and the replacement of the motherboard, I finally broke down and asked for a new machine, knowing it wouldn't be a Mac. Just over a week ago, a new Lenovo Thinkpad arrived, and, after putting Linux on it, I have to say I'm generally very happy with the system.more

In general, Apple puts together a very nice system in the MacBook Pro. The machine is a physical beauty, and the OS is veyr polished and user-friendly. As a developer, though, there were somethings that bothered me. The lack of any real visibility (that I could find) into the packaging system, the use of plists over conventional Unix configuration files, the odd command-line parameter parsing in the shell, the nearly universal requirement to use the mouse, the odd keyboard layout, etc. had been grating on me. Now I'l grant that many of these are silly or easily resolved, but they were different enough from years of habit-building that I never could get completely used to them, nor could I find workarounds that I really cared for.

From a user experience, my complaints realy boil down to personal preferences. Many will likely read this list and think I'm quite a crank for my age, and that's fine. We all have different preferences (I recently read a blurb about a Haskell developer -- I forget his name -- who prefers Windows!. Now that's crazy, right? ;). At the end of the day, I had some minor quibbles with the OS, but I sucked it up and pressed on, and was generally pretty productive. Much more than I was on the Windows laptop at my last gig.

/images/2012/04/cof_orange_hex.jpg

Enter Linux. Or, I should say, re-enter Linux. I've been using Linux for many, many years now, so many of the annoyances I found when using OS X were the result of forming habits in that other Unix-like OS. On this new machine, I installed Linux Mint, which seems to the flavor of the day in some circles, and was mostly pleased. I had some odd issues with menus in NetBeans that seem to be GNOME-related, so I tried LXDE, which I found to be a bit...ugly, and finally KDE, with which I had some stability issues. Over the course of part of an afternoon, then, I installed Ubuntu 12.04, since I had read that they fixed all the woes that at first plagued Unity. Surprisingly, I'm pretty happy with Unity. It has its issues, but the system is fast and stable, and lets me work the way I prefer, which is all I really wanted.

Given my experience with this latest system, I doubt I'll return to OS X in the near future. For me, Linux on the desktop is just about right. The price certainly is.

Java 7, NetBeans, Mac OS X, and a Little Bit of JavaFX 2

Jason Lee 2012-04-09

In a recent post showing how to use JavaFX 2 and NetBeans on the Mac, I noted that I have been unable to run NetBeans using Java 7 on my Mac for reasons I had not been able to figure out. Now, thanks to a pointer from Scott Kovatch , the technical lead at Oracle for the Mac OS X port of Java, I think I can show you how to do that.

Getting Started with JavaFX on the Mac

Jason Lee 2012-04-05

image::/images/2012/04/javafxlogocolor_1-300x150.jpg

As you may have guessed from my recent book review , I've been tinkering with JavaFX some, as time as permitted. I've been following the technology fairly closely since Sun announced the project way back in 2008. When it was announced that JavaFX 2.0 was finally available, albeit in preview form, for the Mac, I was ecstatic. I ran into issues, though, trying to get it to run in my IDE , though. After some guess work and googling, I finally figured it out. In retrospect, it may be obvious, but if you're like me and are missing the obvious, I'm going to detail the steps I took to get it running on my Mac. Perhaps it can help someone out.more

The first step, of course, is to download the binaries. You can do that here , sort of. Since this is still a preview release at the time of this writing, you have click the teeny tiny link under the header. Once you've downloaded the distribution, you need to extract it somewhere:

$ unzip javafx_sdk-2_1_0-beta-b19-macosx-universal-27_mar_2012.zip -d $HOME/local/

You can, of course, put it anywhere you want, but you'll need to adjust the following instructions. The next step is set up NetBeans. NetBeans has JavaFX support out of the box, assuming your JDK has JavaFX support. Since the Mac JDK does not yet, we need fix that. Otherwise, you'll see this error:

/images/2012/04/newprojectbad-300x224.png

To fix this, we need to create a Java Platform with JavaFX support (I don't know why we can't modify the default platform, but we can't, so we get to create a new one, which we can set to be the default if we want). To do that, go to Tools > Java Platforms, where you should see something like this:

/images/2012/04/javaplatforms.png

To create a new Java Platform, click the (wait for it...!) "Add Platform..." button in the lower left corner. OS X likes to put things in decidedly (to me) un-Unixy locations, and the JDK is no different. You can find the current JDK under /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents:

/images/2012/04/selectjdk-300x185.png

We now need to give it a name, so we'll call this "JDK 1.6 with JavaFX" and click OK. But wait, there's no JavaFX support! To enable JavaFX support, we have to...um..enable it. Doing so looks like this:

/images/2012/04/addjavafxsupport-300x185.png

We can now create a new JavaFX project:

/images/2012/04/newprojectgood.png

Your new project is ready to run.

The even more adventurous may be wondering how one would do this with Java 7, to which I say, "Good question!" Adam Bien , but I haven't had a chance to debug things (e.g., the navigation tree under projects has all the tree icons, but no text. IIRC, the context menus are also text-less. Strange).

At any rate, as I noted earlier, in retrospect, this seems pretty easy (if a bit unintuitive) and might be documented somewhere, but I couldn't find it. Either way, it's certainly documented now. I hope it helps. : )

Search

Quotes

Sample quote

Quote source

About

My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

My Links

Publications