Monday, December 05, 2011

At Work With Linux: Digging Into Ubuntu 11.10

Running synaptic from Dash. Note that I've also dropped the synaptic icon on the left vertical launcher.

I received a couple of questions from Rick Reumann via a comment on the post "At Work With Linux - Ubuntu 11.10, Day 2". His questions are at the bottom of the page and boiled down to how to setup synaptic as the default installer such that double clicking on a .deb file starts it up, and how to start synaptic from Dash and hopefully from the launcher.

Starting with the second question I was able to start synaptic from Dash, and I was able to drag and drop the icon to the launcher such that clicking on the synaptic icon launched it. So that part did work for me.

Unfortunately, I have no answers for the rest of his questions. You can't create individual application launchers on the desktop, and you can't create them on the fly on the launcher bar. I did discover while installing the NetBeans IDE 7.1 RC2 downloaded from Oracle that you could programmaticly create an application launcher on the desktop, because it did. And I found that once created I could drag and drop that on the launcher bar. So the hooks are there, buried under the surface is it were. It's just that the UI elements necessary for the end user to do it are currently missing in action.

Investigating Rick's questions uncovered a somewhat ugly side to Ubuntu 11.10, ugly for Java developers. Turns out that Oracle changed the Java license and in the process made it unsuitable for the open source cognoscenti, who dropped it from the repositories and are now offering OpenJava in its place. This is unfortunate for two reason;
  1. OpenJava is only up to Java 6 update 23. Oracle Java is currently at Java 6 update 29 (and yes, I know about Java 7, and that's now what my clients need and use).
  2. I want Oracle Java on all my systems because I want as consistent a cross-development platform as I can reasonably have, using as valid an implementation as possible. Sorry, but OpenJava isn't quite good enough.
So before I could install NetBeans 7.1 I had to hack the system to accept Java 6 update 29. Why? Because NetBeans 7.1 flagged the OpenJava version that was installed with Ubuntu 11.10 as "not suitable". Basically, I had to download the installation binary from Oracle (which does nothing more than unpack it into a directory), set up a local JAVA_HOME variable and modify the PATH to point to this, and then drop a copy of Java update 29 (jdk1.6.0_29) into /usr/lib/jvm. Under /etc/alternatives I changed a soft link to point to my Java (ln -s /usr/lib/jvm/jdk1.6.0_29/jre/bin/java). Did I call that a hack? It's a damned ugly hack.

Between those two changes I got the version of Java I wanted to work with the version of NetBeans I wanted, and that's when it dropped the launcher on the desktop.

Next I grabbed the latest Eclipse releases from the Eclipse website (both 3.7.1 and 4.1.1) and unpacked them in my home directory. While Eclipse worked if launched from the command line, there was nothing I could do to get Eclipse to launch from any part of the desktop. I could have used synaptic or Software Center to install Eclipse 3.7.0 from the official repository but when I looked at all that would have been installed I said 'No' to all that additional baggage. When I install Java and supporting tools, I'm very picky about what gets installed, both with regards to versions and specific tools. I've done this for some number of years now, and I won't change to somebody else's idea of what I need. The less I install the better off I am.

At this point I can't actually recommend Ubuntu 11.10 for Oracle Java development, and it may be a bit tough for other types of development as well, especially if you want to step outside of Ubuntu's carefully curated software system. It shouldn't have to be this hard. In the past I would have dropped my version of Java in my local directory, set JAVA_HOME and PATH in .bashrc and be done with it. But I can't even do that. I know I have a problem when 'which java' returns '/usr/local/java' while 'which javac' returns nothing but I still get the right version of javac and jar when executed (for the record the only JRE is installed on Ubuntu out-of-the-box). I guess that's why I stick with Fedora and RHEL and OpenSUSE, just to name three.

We'll continue to use it for OpenStack development because Ubuntu's recommended. But once we get up the learning curve on OpenStack I intend to move OpenStack development to a more robust development platform.

Update 6 December

Shame on me for not looking on the web for answers to customizing Unity. However, even the answer is fraught with peril as it were. First, here's the link:

To quote from the linked page:
Creating a custom launcher for Unity is simple. Quicklists provide an easy and efficient way to quickly access commonly used tasks for a specific application.

NOTE: Starting with Ubuntu 11.10, this popup option has vanished. Launchers can now only be created by editing text files in your home folder.

No comments:

Post a Comment

All comments are checked. Comment SPAM will be blocked and deleted.

Note: Only a member of this blog may post a comment.