Running an external program is much slower than calling a JNI function. But, if you are only doing it once (probably true in your case), running an external program may be fast enough.
Passing complicated data between and external program and your Java code can be more difficult than doing it in JNI. However, in your case, the data is unlikely to be complicated.
Once you have added your first bit of JNI to your program, every subsequent bit of JNI is much easier than the first; you'll already have sorted out how to build the library, how to load it, how to deploy it in your installations etc. Therefore, think carefully. If getting the hard-drive serial number is the only thing you need to do outside pure Java, it's probably not worth JNI. If you are likely to end up needing lots of similar facilities, you should probably go for JNI.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
posted 12 years ago
Thanks a lot for the advice Peter.
I'll take the external program route as I highly doubt I'll need to do anything externally again.
Nothing? Or something? Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop