launching windows 8 on a vm

My “Windows computer” is a Windows XP machine that is over 7 years old and barely works. I still have it because every once in a while I’ve used it to test something in Internet Explorer. It doesn’t have the latest patches, virus scan, software etc. And it is really slow. My work computer has Windows, but that is meant for work. I’m about to start on something where at home it would be convenient to have easy access to Windows. I already have a href=”/tag/virtualbox/”>VirtualBox on my Mac for Ubuntu and Chrome OS.

I decided to go with Windows 8 because it is the future.  No time like the present to start getting used to that OS.  My theory is that it will less aggravating using it for little things rather than waiting for it to become my primary computer one day.

Plus you can test out Windows 8.1 Enterprise for free for up to 90 days.  PCWorld has a great article about it.  The install was between 30 and 60 minutes.

Once the VM was installed, it was fairly simple to get started:

  1. Download JDK from Oracle and install
  2. Click down arrow in bottom right corner to get list of apps
  3. Type “Command” to get the DOS prompt.
  4. Right click “Command Prompt” to pin to start menu so can get to it right away next time.
  5. Update path from control panel

Overall, my first impressions are that Windows 8 is very colorful.  And that if I didn’t know what to search for, I wouldn’t have found what I needed.

Second impressions

They moved everything.  I’m able to do what I need, but it feels like someone moved around all my furniture, hid some things and said “well, you just have to ask for them.”  I am so glad that I don’t have to do work on this thing at the moment.  And it feels like it takes a lot of clicks to do anything.

Communicating with the VM

You can copy/paste from VirtualBox.  I decided to use github instead though as I already have the code I want to try on Windows in a private github repository.  Github has a Windows client.  I’ve never used it so decided to download to see what it is like.  It is only 41.2MB, but downloaded really slowly.   The app provided a UI to clone a repository in github which it automatically checks out into Documents/github/repo-name.  The UI is nice, but I wound up using the git bash shell provided with the application.  Which meant it really only saved me some setup.

Other options would have been Dropbox or just use the copy/paste functionality from VirtualBox.  (I really didn’t want to do that for whole files.)

jeanne on software – thoughts on Joel Spolsky’s “Smart and Gets Things Done”

A co-worker gave me a copy of “Smart and Gets Things Done” by Joel Spolsky.  It came out in 2007 so his thoughts might have changed since then.  Or not.  I have read Joel on Software so much of this isn’t new to me.  But I have more experience than I did in 2007 so it was interesting to see how I react to it now.

Banks

Over time, I’ve seen a number of references from Joel referencing banks or accounting systems as “boring” work. (I work for a bank.)  I almost would have been disappointed if that wasn’t in the book.  It was.  On page 16 – the very end of chapter 1 – Joel writes “That’s why the most satisfying careers, if you are a software developer, are at actual software companies, not doing IT for some bank.”

Maybe, maybe not.  I’ve worked on challenging projects at “some bank.”  I do think that it is important that the company values IT and has a development or IT group.  If it is literally “here’s what the trader wants now go and please him” I can see where Joel is coming from.

And I do agree that banks aren’t typically the early adopters of innovation.  I don’t want Chase experimenting with some new funky way of managing transaction integrity.  Their appetite for risk should be lower in that arena.  However, performance counts when doing a trade.  Amazon has to worry about scale with acceptable performance, but they don’t have to worry about the difference between a quarter of a second and a half a second on individual transactions.  Incidentally, Amazon is a “name” employer to work for and doesn’t produce software as it’s primary business of sales either.  (Although with Amazon Web Services and the like, you could argue it is a software house as one of it’s primary business.)

Paid interns

I’m glad to see that Joel pays his interns.  Interns don’t produce at the same level as experienced employees, but they do create value.  I remember being asked one summer if it was worth having an intern on our team.  The answer was yes.  It took about a month to get the intern independent enough to hit the break even point.  Leaving two months of progress.  There was some progress in the first month of course, but we were still within the “faster to do it myself than train” area then. I also like that Joel views interns as a recruiting channel.

I remember in college having an unpaid offer for an internship (with a small healthcare company) and a paid offer for an internship (with a large bank).  I chose the later.  While I didn’t end up working for that particular bank when I graduated (although I could have), it certainly got my foot in the door in that industry.  I also learned more because the larger company was set up to actually have their interns learn while producing rather than look at them as cheap labor for tasks they already know how to do.

Employee referrals

Joel feels that employee referrals are a very weak source of hires.  He says he will skip the phone screen, but that’s it.  I strongly agree that you should still interview referrals to make sure they are skilled, have good communication skills, fit, etc.

However, I disagree that employee referrals are a weak source of hires.  Personally, I’ve made two referrals in my career.  Or one depending on whether you count recommending someone for another team within the company.  Both are individuals I think are very good.  I wouldn’t recommend them otherwise.  It affects my reputation if I recommend someone bad.  And for the external one, we didn’t skip the interview.

There are different types of employee referrals though.  Both of mine were “I worked with this person and think she would be good on team X because.”  I wasn’t disappointed in either case.  By contrast a teammate recommended a friend that he never worked with.  I did the interview and declined to hire that individual.  However, this referral wasn’t “this person is awesome”.  It was “this person is easy to get along with and is a programmer”.    Yes, that’s a weak recommendation.  But no weaker than other sources.  It doesn’t make referrals  weak across the board.  And it shows the reputation thing I was talking about.  He gave an honest evaluation of the weakness in the referral.

Private offices vs team rooms

Joel is big on team rooms.  I have mixed feelings about this.  I don’t need quiet to work.  I do need to be left alone at times.  I like hearing coworkers conversations as you sometimes hear something important.  I like working collaboratively.  I don’t like bothering people with my conversations who prefer quiet.

To date, my favorite environment has been cubicles where teams were located in neighboring cubicles.  Or two to a well designed cube.  At both my summer internships and when my team had interns, I shared a cube.  But it was designed well.  The computer was in a corner with a desk on both sides.  (I needed to add a cardboard box to make that happen in one of these scenarios, but it still happened.)

I’ve never seen a proper team room in person though.  I’ve seen the “everyone bring their laptop to a table and hunch over.”  That’s horribly unproductive to me.  Having a keyboard/mouse/monitor at proper height and a second monitor makes me much more productive.  Yesterday, I made a comment to a teammate about not being able to imagine working in a team room full time because of this lack of setup problem.  He said that’s not what a real team room is.  And he’s right.  I googled team room and found this and this.  Unfortunately, I also found this. I started a thread at CodeRanch to discuss the topic of team rooms.

Passion at Interviews

Joel writes about how being passionate about a topic gets rid of nervousness at an interview.  I remember at one of the interviews for my current job, I argued that pair programming works well when two people have approximately the same skill/knowledge level, but not when one person is a lot more experienced.  (I no longer hold that believe for anyone curious.)  I completely forgot I was at an interview during this conversation.  So yes, being passionate about a topic gets rid of nervousness.

upgrading to mavericks – problems including broke eclipse/ant java for jmockit – and how to fix

I didn’t upgrade to Mavericks right away because I was getting FIOS.  If there were internet problems, I wanted to know they were Verizon’s fault and not be in a position where they could claim it was my computer’s problem.  I’ve had Mavericks long enough that I can write about the experience.

The problems describe here:

  • git
  • Eclipse/Java/Ant/JMockIt
  • OpenOffice crashing

How long it took

Not counting the download, the install took 2 hours.  Much of which was Apple saying there were “17 minutes” left.  I left it alone and it didn’t finish though.  I’ve seen reports of significantly faster installs though.

Problem #1 – git

The first problem I ran into was the error message The “git” command requires the command line developer tools.  Not a big deal.  It was a two minute install.  I was just surprised as I was expecting what was installed before the upgrade to  be installed after.

Problem #2 – Java and Eclipse

And now for the meat of this.  Being able to develop again in Eclipse was by no means seemless.

Error: Ant can’t find Java

Exact message: Specified VM install not found: type MacOS X VM, name Java SE 6 (MacOS X Default)

Solution – for each Ant build:

  • Run > External Tools Configuration
  • Run in same JRE as the workspace

Error: JUnit tests don’t run in Eclipse view

When running from Eclipse, I got the stack trace:


java.lang.IllegalStateException: Unable to load Java agent; please add lib/tools.jar from your JDK to the classpath

at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:102)

at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:74)

at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:41)

at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:271)

at org.junit.runner.Runner.<clinit>(Runner.java:25)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:35)

at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

java.lang.NoClassDefFoundError: org.junit.runner.Runner

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Solution:

First I tried switching creating a new installed JVM of type MacOS X JVM.  That didn’t help directly.  I left it like that since I didn’t want to muck around with my original configuration.  Then I added tools.jar to the installed JRE.

  1. Eclipse > Preferences
  2. Java > Installed JREs
  3. Click target JRE
  4. Edit
  5. Add external jars
  6. Add  /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/lib/tools.jar

Warning: The first time I tried this procedure, Eclipse hung.  I had it to kill it.  When I opened my workspace, I saw “unable to load plugin x” in every single view.  I used Time Machine to restore to before I tried changing the JREs and then re-did that change.  The second time it was successful.

I could have added tools.jar to my classpath for the project instead.  I choose not to because I was hoping updating it in the JVM install would solve the Ant problem (described below) as well.  It didn’t.  I also didn’t want to change the project .classpath as that is shared in Subversion and I didn’t want to make a change that affects others.

This whole exercise felt like a hack until I read the JMockIt instructions.  This leads me to believe I was running with a different JDK before the Mavericks upgrade.

If you are developing on a JDK of version 1.6 or newer on Mac OS X, add <jdkDir>/lib/tools.jar to the classpath, where <jdkDir> is the home directory for your local JDK 1.6 installation.

Error: JUnit tests don’t run from Ant

When running from Ant, every test failed with:

Caused an ERROR</span>
<pre>
null

java.lang.reflect.InvocationTargetException

at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

What I learned:

  • I tried setting JAVA_HOME at the command line to no avail.  I confirmed javac is on the path. (/usr/bin/javac); it was.
  • I tried adding tools.jar to the classpath in launch configuration in Eclipse for running Ant.
  • If I change to fork=”no” in the <junit> task in the Ant script, most of the tests pass.  (Some of them require the JVM be forked which is why it was in the first place.) Showing the problem is when a new JVM is created, it doesn’t inherit the tools.jar from the previous step.
  • If I hard code the classpath entry for tools.jar in the Ant build file, all of the tests pass.

Solution:

If you need to fork the JVM, add the following insider you <junit> task.

<classpath location="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/lib/tools222.jar" />

I don’t like this solution.  I also didn’t like the hack for Eclipse so my unease is pretty uniform here.  Luckily Ant doesn’t choke if you include a file (or disk or filesystem) in the classpath that doesn’t exist.  Which means this won’t hurt others working on the same project.

Problem #3 – Open Office crashes when opening a document

The solution was to upgrade from Open Office 3.3.0 to the latest (4)

My favorite new feature

It’s a minor one, but I like the feature to synchronization of “Read Later” between my Mac and iPad.  (I haven’t tried it yet so it may not be that nice in practice.)  Most of the new features are things I don’t need.