Tuesday, June 28, 2011

Don't Use "Duplicate" button to add a new JRE/JDK in Eclipse

You may be tempted to use the "Duplicate..." button to add a new version of a JRE/JDK in Eclipse. Save yourself some potential hassle and use the "Add..." button instead. Manually copy and paste any Default VM Arguments you may have set afterwards.

The problem with using "Duplicate" is that all of the system library links remain at the old JRE/JDK after you update the "JRE Home". This can cause very strange errors, such as the following:

ZipFile.open(String, int, long) line: not available [native method]   
JarFile(ZipFile).(File, int) line: 114     
JarFile.(File, boolean, int) line: 135  
JarFile.(String) line: 72         
URLClassPath$JarLoader.getJarFile(URL) line: 646              
URLClassPath$JarLoader.access$600(URLClassPath$JarLoader, URL) line: 540        
URLClassPath$JarLoader$1.run() line: 607             
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]    
URLClassPath$JarLoader.ensureOpen() line: 599  
URLClassPath$JarLoader.(URL, URLStreamHandler, HashMap) line: 583          
URLClassPath$3.run() line: 333   
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]    
URLClassPath.getLoader(URL) line: 322   
URLClassPath.getLoader(int) line: 299     
URLClassPath.getResource(String, boolean) line: 168        
URLClassLoader$1.run() line: 194    

Some coworkers did this, and it caused a lot of headaches trying to figure out what was happening. Practically half the dev team has tried it at one point and learned the painful lesson, and it is an easy mistake to make.

If you insist on using "Duplicate...", then there is an easy fix. After you've updated the JRE location, if you use the "Restore Default" button it will update your JRE library entries. It's still very easy to forget this step, which is potentially a lot more work than just copy pasting your Default VM Arguments. If you forget to copy those, diagnosing out of heap errors is a lot simpler.

Wednesday, May 4, 2011

Creating a Multi-boot USB drive

Creating a bootable USB thumb drive from a single ISO is handy, but not on its own any big advantage over a bootable CD. A multi-boot USB thumb drive with every bootable ISO you want? That's something that is extremely useful, if you tend to need that kind of stuff frequently. It can also be a real time-saver - both by saving you time hunting through your stack of burned CDs, and because a modern USB thumb drive will load files dramatically faster than a CD-ROM will.

I had kind of found a few ideas in the past, but last week I set out to start creating a multi-boot USB drive with all of the tools I frequently use. I picked up a 32GB thumb drive that should have plenty of room. To make my USB drive multi-boot, I used the YUMI Multiboot USB Creator.

It is basically an NSIS installer that lets you select a USB drive, make it bootable, and select what ISOs you want to load. It will format it FAT32 for you if you want. (I'm not positive, but I suspect FAT32 may be required for some boot CDs/floppy images). It will even initiate the download of all of the ISOs it has in its prebuilt list. I found this really useful, though occasionally a newer version of a tool would be out and it wouldn't directly find it. It was still very easy to use. It also allows you to add unlisted bootable ISOs, which it will add to a separate list. I tested this with 2 vendor diagnostic boot CDs and they both worked - your mileage may vary with some ISOs.

A point of confusion for me was how to add MULTIPLE ISOs. YUMI Multiboot USB Creator is designed to be run once per ISO. Don't try to add all of them at once, or you may end up scratching your head for a few minutes. Add them one at a time. At the end of each addition, it will ask you if you want to add another or not. Clicking yes, or running it again will add an additional bootable ISO while maintaining any that are already installed.It doesn't currently provide a way to remove a bootable ISO, so if you accidentally load the same one twice or otherwise want to remove one, you will have to edit the menu files by hand. This does appear to be a planned feature, though, so that may cease to be the case at some point. The version as of the time of this post is 0.0.1.1 - this version came out a couple of weeks ago, so it appears to be actively in development.

Here are some of the ISOs I loaded on mine:
  • Clonezilla
  • GParted
  • DBAN
  • Memtest86+
  • FreeDOS
  • Ubuntu
  • Vendor Hardware Diagnostic CDs
Be sure to read the known issues list. If you load a Windows 7 install CD on there it may interfere with Ubuntu-based distros loading, and there are a few other minor caveats. I am very impressed with this though and look forward to utilizing YUMI Multiboot USB Creator to add more ISOs in the future.

Tuesday, May 3, 2011

Easily create an ISO image of a CD/DVD

I occasionally find myself needing to create an ISO from a CD/DVD at work. Whether it's of some volume media, a diagnostics CD, or other CD that is created by a vendor. Today I found myself searching for a simple, free tool that does this. In particular, I recently burned a Lenovo diagnostics CD - it would not let me just create an ISO. I want an ISO so it can be a part of my multiboot USB drive with every ISO I frequently use.

Thanks to a question on superuser I located and the corresponding answers, I found LC ISO Creator, a 14KB (KB!!!) freeware tool from Lucersoft. It's as simple as it gets, and it works great.

Wednesday, April 13, 2011

Browser Behavior Audit: Mailto: links

I don't run a desktop mail client any more at home. I'm sure most users don't. It's because of this that I have no default mail client installed. Occasionally I click a mailto: link. Maybe I want to email someone from their contact page, or sign up for a mailing list.

I was a little surprised when I tried this in Chrome and nothing happened. No error, no dialog, no beep. NOTHING.



Let's do a quick audit of the current browsers:

Chrome 10: nothing happens. This sucks.

IE9: Error dialog:

This sucks, but at least it tells me.


Safari (latest as of this writing):
Similar to IE9...

Opera 11:


Much better. However, if I choose system default, nothing will happen once I click on links. It at least prompts me with options though - it receives a passing grade. Note: Gmail is not currently a web mail service option, or I would be more excited that it offers "web mail service" options. The built in mail client is nice, though, so it is a valid option.

Firefox 4:


Gold star Firefox. Gold. Star. Firefox not only prompts me, it has a gmail option. I'm already logged into my gmail in my browser anyway - if I am, it will directly open a compose mail for me. If not, it will bring me to a gmail login page. GIANT HIGH FIVE!!! Usability Win!

I was so delighted to see this screen with a gmail option, I drew a trophy for Firefox 4:
My drawing skills are lacking, but Firefox 4's user experience skills certainly aren't. I'm impressed. In fact, the more I toy with Firefox 4, the more I like it.

We live in a webmail age - I bet most people don't have desktop mail clients any more. Why is such basic functionality seriously lacking? Does nobody ever click a mailto: link? (I admit I only do so a couple of times a year). It may be a minor qualm, but I expect these types of simple usability cases to just work.

Monday, April 11, 2011

Port test websites rock

So you're at home, and you want to connect with a friend online. Maybe it's some Minecraft and you start your own server. Maybe it's an XMPP server for a little pair programming with Saros. Whatever the case, you've likely got multiple barriers to success. Your OS firewall. Your router firewall. NAT.

You try one thing, then hope it works. Then try again. How do you know it will work? An external port tester.

That's when a website like http://www.canyouseeme.org/ comes in. It will check if your port is open from the web or not, and save you time. Saving time is good. I think in the future routers should offer this functionality themselves. Let me pretend I'm outside, and I'll tell you if I can reach you. That would be sweet.

Thursday, April 7, 2011

Hyper-V Server 2008 R2 Remote Disk Management from Windows 7 on a Domain

I'm in the process of migrating a build machine to a Hyper-V Server 2008 R2 SP1 setup. I'm relatively new to Hyper-V, and may also be comparing with other options. The Hyper-V Server is joined to the domain, all standard remote management options from the console are turned on. I could connect with the Hyper-V Manager from a Windows 7 machine fine, but could not remotely manage the disks in Windows 7. I read this post and here is what worked for me.

On the connecting machine, Windows 7, I had to add the following firewall rule:

netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes

Remote management of Services was working, and I had enabled Virtual Disk Service on the Hyper-V box. Following a reboot, I could finally manage the disks remotely.

Prior to this, I believe any servers on the domain could manage them - just not my Windows 7 workstation.


This is only the beginning of my hypervisor adventures, as I try to convert 10 physical build machines running Jenkins masters into a fully virtualized fleet, double the amount of builds that occur, and centralize to 1 hudson master. I'll try to chronicle my findings here on this blog.

Tuesday, March 22, 2011

Why add-ons suck

This dialog, that's why:



Firefox 4.0 is officially out. I think it's great that Firefox has such a huge array of add-ons. They make a lot of people happy, and are often a justification for why people like the browser. The problem is when I upgrade to a new version and I can no longer use an add-on that is part of my core usage... This has happened a great many times...and every time it is less and less cool.



I'm probably in the minority for considering mouse gestures mandatory capability - but I do, and that requires an add-on in Firefox. There is hope, though.

The Firefox team seems to be taking a nod from Chrome's release cycle, and have vowed much faster, smaller releases going forward. From the "How to ship faster" section of the 2011 priorities/roadmap there is the following bullet point:
we must provide binary compatibility for Add-ons 
If that happens in 6-8 months (or whatever the timeline), it would remove my single biggest irritation with Firefox. Aside from the above dialog, Firefox 4 seems to bring an aweful lot of good to the table. I continue to happily keep 4 browsers installed on my machine...