I blogged a few days ago about an exception that was cropping up when doing a Desktop.open() on OS X.
Tonight I hacked out a simple solution.
Instead of
Desktop.open(file);
I do:
if (OSUtils.isMacintosh())
{
Runtime.getRuntime().exec(”open”, file);
}
else
{
Desktop.open(file)
}
OSUtils.isMacintosh() just does a check against ‘os.name’ to see if it matches the signature of a macintosh.
Pretty simple. I haven’t actually tried it out in the application yet, but a simple test had it launching the native text editor so it appears to work as expected.
-
Pet Peeve: Don’t email my password to me in plain text You know the drill.
Signup for some random service on the internet
Receive a confirmation email with your account information
or
Forget a password for some random service ...
-
Eclipise Memory Analyzer (MAT) I must say the Eclipse Memory Analyzer looks pretty slick. There is some pretty good material over on the developers blog. Lastly, there was a talk on it ...
-
Open-source Web-based Code Review Tool: Rietveld Guido van Rossum, of Python fame, has recently released a Django-based application that enables web-based code reviews... Rietveld.
It supports any language and currently can hook into Subversion repositories. You ...
-
An implementation of the JVM in Javascript? Caught this over on JavaPosse Google Groups.
Essentially, some bright fellows over in Japan have developed a bytecode->javascript compiler. There's a demo floating around that took a Tetris ...
-
Facebook Chat? So it looks like the Facebook Chat service has finally started rolling out to my network (Facebook Chat has been mentioned previously).
Not quite sure how ...
Latest Entries
- Lessons Learned as a Project Lead
- Good ANTLR Resource
- Testing with Unitils
- Headed to Kelowna for a short vacation (and the laptop stays behind)
- Seam + Groovy + Maven : Nice Simple Hibernate POJOs
- Pet Peeve: Don’t email my password to me in plain text
- Eclipise Memory Analyzer (MAT)
- caBIG Annual Meeting - A developers perspective
- OS X + Java6: java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib
- Getting started with JBoss Seam and Maven
Blogroll
Apr 7th, 2007 at 2:04 pm
I’ll have to try your problem out on a mac.
I use JDIC to open files for my apps that need to run across platforms and did a little write up on it at:
http://timarcher.com/?q=node/17
I have never encountered the error such as you’re describing. I’m going to have to try to grab a mac at work and test it our. Thanks for the heads up, hopefully you’re finding will save me some headaches later on down the road. I’m requiring JDK 1.5 for my app, so I’m really hoping JDIC properly opens files under that JVM!