Java Woes on Snow Leopard (10.6)

Posted: September 09, 2009

Correction: I just discovered that this is not a J2SE 6.0 issue but rather a 64-bit issue. The 64-bit version of the J2SE doesn't play nice with Aventail Connection. Simple updating your preferences to put J2SE 6.0 (32-bit) ahead of the 64-bit version works and you don't have to do all of this.

I just installed Mac OS 10.6, Snow Leopard, on Friday before I went on vacation and was disappointed to find that the upgraded version of java that it had installed broke my Aventail Connect VPN client. Neither the web interface nor the desktop client works under Snow leopard.

It would appear that you can run different versions of java concurrently but Snow Leopard lies marking java 1.6 as 1.5.0; looking at the confusing mess of java version symlinks it's no wonder things don't work:

/images/blog_pics/java_versions.png

It turns out the fix for this is pretty simple, just downgrade java versions. To do that you'll need to grab a version from 10.5 Leopard. There's a version posted at the University of Washington and I'll mirror a copy when I get a chance. Download this and untar it. Here's the complete set of steps:

cd /tmp/
wget http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz
tar -xvzf java.1.5.0-leopard.tar.gz
su
mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
cd /System/Library/Frameworks/JavaVM.framework/Versions/
rm 1.5.0
ln -s 1.5.0-leopard 1.5.0

Once that's done you should now be able to mark that version of java as the preferred version. To do this you need to run the 'Java Preferences.app' which is located in /Applications/Utilities. The only required changes are to re-arrange the versions of java for both applets and applications. This is what my final configuration looks like:

/images/blog_pics/revised_java_settings.png

Now that java has been downgraded successfully you should be able to start up Aventail Connect and connect to your VPN just fine. The browser version works again too. This shouldn't affect any other java applications on your system but I haven't done any testing to verify this. In any case, once Sonicwall updates their client for Aventail you can just move the J2SE 5.0 version to the bottom of the priority list and continue working as usual.


Pointy-Haired Bosses and Pragmatic Programmers

Posted: January 08, 2009

The keynote at CodeMash this morning was really excellent. Venkat Subramanian made some excellent points about testability, maintainability and outsourcing.

At one point he drew a correlation between exercise and unit testing. All of us will admit that exercise is a "good thing" to do but when asked to actually exercise we have any number of excuses why we don't want to or can't. The same thing happens with unit testing. We'll all admit that its a good thing to do but we never have the time to do it.

One argument we make for why we don't write tests is because our code "isn't testable." Well the phrase "My code isn't testable." really just means "My design sucks."

He also talked about outsourcing and why the normal excuses for it just don't work anymore. Outsourcing 1.0 was basically the idea that you should hire designers in American and lowly programmers in Asia. Think back to the .com boom when we had the programmers and designers all in the same physical location and how that worked out for us. Now add oceans in-between them and that should work better, right? The real strategy you're adopting by throwing more, albeit cheap, people at a project is you fail-for-less.

Outsourcing 2.0 involves more than just simply hiring programmers in Asia, it involves integrating them into the team. Sending people from America to Asia and bringing the Asian programmers to America is what's needed to integrate the team and set yourself up for success. At that points it's no longer a cost saving measure, you're adding team members for the perspective and talents.

Overall quite excellent. I hope they where taping that and that he posts his slides. I'll update the post if they do.


Impressions of .NET

Posted: January 07, 2009

Today I spent the entire day in the .NET session at CodeMash. Now I have pretty much no practical interest in .NET but the whole point of CodeMash is to expand your mind, so why not. I was pleasantly surprised and in cases downright impressed.

For the purpose of background it's worth noting that Microsoft has put a pretty substantial chunk of change into this conference. They have signs everywhere as well as a room or two dedicated to their workshops. They're also listed as an adamantium sponsor (the highest level).

Before I get into the rest of the post I have two mini-rants to address. First of all is that Windows Vista is UGLY, like really ugly. Whoever thought huge translucent borders for windows was a good idea was clearly on something. It's pretty distracting and wastes lots of screen real-estate. All the superfluous animations are annoying and distracting too. The other thing is that GUI development environments and wizards drive me batshit and EVERYTHING you do in .NET assumes that you're using Visual Studio. I'm with Charles Petzhold in the thought that Visual Studio rots the mind. If I'm editing text I want to edit text and get the GUI crap out of my face, it just gets in the way.

Okay... on to the real post...

I haven't actually be "into" Windows desktop development for the better part of 8 years and even back then it was just VB 6 which is comparatively quite primitive to the current state of .NET. When .NET originally came out was about the time I was making the transition to web development and so I basically wrote off Windows as a lost cause. I've got to say that I'm honestly really impressed with the current state of Windows development. Apple has really thrown down the gauntlet with their beautiful interfaces and really nice development tools which Microsoft has picked up. They are taking the challenge very seriously and it shows.

The old way to do .NET development was WinForms which is visually pretty status-quo for Windows applications; plain, boring, ugly. The new awesomeness which appears to only be in Windows Vista and up is Windows Presentation Framework which is pretty amazing. WPF allows you to do all kinds of really nice interface fanciness from 3D interfaces that slide and flip to real-time moving graphs of data that can be stacked and rotated in 3D. The demo apps they showed are certainly up to snuff for some of the more snazzy Mac applications that I've seen. The only thing I can see happening with WPF is programmers getting overzealous and adding too much WPF bling to their applications.

The other technology that was discussed which I'd totally underestimated was Silverlight. At a first glance Silverlight was just a wanna-be Flash clone which was lame. On closer inspection Silverlight appears to be a pretty serious competitor for the likes of AIR and Flex. Basically Silverlight pairs XAML with C#. The two are really pretty powerful together, and fast... the one demo of a chess game put Silverlight at 60x the speed of Javascript (which makes sense when you consider that C# IS JITed). The authoring tools are pretty good too. Though I did have to laugh when the presenter said they where positioning Expressions Studio as a competitor for Photoshop. Seriously?

The last thing that was demoed was ADO.NET and Linq. ADO.NET really isn't anything special, its a database abstraction layer. Whoopty freaking doo. Linq is the .NET attempt at an ORM. Having not done any further study on the topic I can only say what I saw, and it wasn't pretty. Basically Linq gives you a storage-agnostic way to select data from a database. By all accounts it is inverted SQL entered directly into your source code (i.e. NOT a string). Well that's pretty gross. What's even worse is you have to write Linq (LINQL?) backwards, your from statement comes before your select statement. When asked why the presenter informed us all that this was so intellisense could figure out what you where trying to get at. I threw up in my mouth. The idea of tailoring the language to the tools instead of the other way around is SO preposterous that I don't even know where to begin.

Overall once the sales pitch for .NET was over and the demos began it was really impressive. I've got to give Microsoft some serious credit, they are taking .NET seriously and forthcoming versions of Windows will be adding some really neat stuff to a Windows developer's toolkit.

The one thing that I'd really like to see Microsoft take seriously is other platforms. It's very clear that in the Microsoft world there is only Windows and the fact that you may be using an "inferior" operating system is just beyond their comprehension. Of course this is understandable since they make Windows and they all use Windows. But it would be really grand if Microsoft would officially port .NET to other operating systems like Mac and Linux. They could have some serious competition for Java and bring some of the cool stuff they're working on to the rest of the world. Until they do that .NET is probably irrelevant to me but it was still neat to see what they've got and its nice to know if the web thing doesn't work out there's a decent toolset to go work with.