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.)

creating a groovy project with gradle in eclipse

Last month, I went to a talk on gradle.  Today I decided to give it a shot.  My goal was to create a simple groovy project with gradle.  I did it in less than 30 minutes so getting started was fast.

Setup

I already had the Groovy Eclipse plugin.  I then installed the Gradle plugin from the Eclipse marketplace.  Yes, this could be done at the command line.  I’m used to M2Eclipse IDE integration so wanted the same for Gradle.  This step went as smoothly as any other plugin.

Creating a new gradle project

Just like Maven, the first step is to create a new Gradle project.  Since Groovy Quickstart wasn’t in the list, I choose Java quickstart.   The create request appeared to hang, being at 0% for over five minutes.  This was the first (and really only) problem.  I killed Eclipse and started over.  There was no point in doing that.  It just takes long. Apparently, this is a known issue. I tried again and after 5 minutes Gradle did download dependencies from the maven repository.

Making the Java project a Groovy project

Java quickstart does exactly what it sounds like.  It creates a project using the “Maven way” directory structure for Java.  To adapt this to a Groovy project, I:

  1. hand edited build.gradle to add
    apply plugin: 'groovy'
  2. hand edited build.gradle dependencies section to add
    groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.10'

    (I actually missed this step on the first try and got the error “error “you must assign a Groovy library to the ‘groovy’ configuration”.  The code was documented here.)

  3. created src/main/groovy and src/test/groovy directories
  4. gradle > refresh source folders.  This is like Maven where you need to refresh dependencies and the like to sync the Eclipse workspace.
  5. gradle > build > click build (compile and test)

Impressions of the gradle plugin

  1. I’ve mentioned a few times that it is very similar to the Maven plugin.  This is great as the motions feel very familiar and only the part that is new is gradle itself.  (Well that and refreshing my groovy knowledge – it’s been a while.)
  2. You can run your GroovyTestCase classes through Eclipse without Gradle (via run as junit test)
  3. My first build (with one class and one test class) including some downloading the internet took 1 minute and 2 seconds.  My second build took literally two seconds.
  4. I like the “up to date check” so only some targets get run.
  5. I like that you get an Eclipse pop-up if any unit tests fail.
 
This blog post also motivated me to start using my github account to make it easy to show the code.  In particular, the build.gradle file or the whole project. (This class doesn't require any programming so I think it is ok to put this online.  If Coursera complains, I will take it down.)

git plugins for eclipse and netbeans

Last year, I tried out Git for the first time.  The command line was fine, but I really like my version control to be integrated into my IDE.

Overview

Git shines at some things.  Aside from the common ones, it is useful when internet access is unreliable.  We take connectivity for granted.

NetBeans

I hadn’t tried the NetBeans plugin last year. I mainly use Eclipse and only use NetBeans when working with a local robotics team. As such, I haven’t used NetBeans in eight months and needed to update it before I could try installing the NetBeans Git plugin.

Note: This Git plugin is in experimental mode. It will likely stay there as Oracle is working on an official plugin. Check Oracle’s page for updates. (Nice to see they didn’t abandon NetBeans after taking over Sun.)

The install procedure to connect to an existing repository:

  • Tools > Plugins
  • Select available plugins tab
  • Search for git
  • Click checkbox next to nbgit
  • Click install
  • Next and agree to license
  • Install
  • Continue to acknowledge it isn’t a signed/trusted plugin
  • Finish
  • Close
  • Team > Clone Other
  • Enter URL of git://github.com/prog694/frc
  • Enter directory/clone name if want to change. I had to change the clone name since the default was in use from last year’s Subversion project.
  • NetBeans looks for projects in that repository. I got a pop-up saying 7 projects were found and was asked to click “open project.” Select one or more projects to open them.

Eclipse

I tried egit again. This didn’t go well last year.  It’s now a year later and I’m on Eclipse 3.6 (Helios) instead of 3.5.  Things went much better this time around.

The install procedure to connect to an existing repository:

  • In Eclipse, connect to the update site.
  • Download all available plugins (egit and jgit).
  • Eclipse restarts
  • Change to the Git browsing perspective
  • Choose “clone Git repository”
  • Enter the URI.  In my case it was git://github.com/prog694/frc.  Note this same repository is available in a browser at https://github.com/prog694/frc.  All I did was change the protocol to git to connect. 
  • Since this repository is open for public browsing, I do not need to supply a username and password
  • Click next
  • Click next again to select the master
  • Click finish
  • Wait a minute or two
  • Expand until you find the project you want to checkout. (In this case, the actual project is a NetBeans project in this case so you can’t check it out as a project.  You can browse it in the repository view if you really want to check something.)

Conclusion

Both plugins are intuitive to use if you’ve a CVS/SVN plugin before.  Right click the project, choose “git” and the relevant option.  It’s nice to see the integration is seamless now.