Installing Eclipse IDE for Java Developers

I feel like a lot of  my posts are basic software installs.  One day, this will become second nature, I’m sure…

To play around with more Java programming, I’ve decided to try out Eclipse and use Eclipse instead of JGRASP.  Eclipse has so many features to help simplify the programming process; I’m irritated I didn’t take my sister’s advice and install this during my computer programming course.

Anyway, I grabbed the 64-bit Eclipse IDE for Java Developers tarball and extracted it using the Ubuntu graphical user interface (GUI).  I moved the extracted folder to my home folder and then added an alias to my bash_aliases file.

I don’t know how to restart bash to honor updates to system files, so I restarted the computer.  Booya!  Eclipse installed and launchable from Terminal by simply typing:

$eclipse

Installing a version control system (SmartGit)

I’ve been taking a computer programming course and finally decided I’d like to have some sort of version control so that I can revert to older versions of the programs I’m writing in case I totally jack something up.

I selected SmartGit from the Git website’s list of Linux version with a graphical user interface (GUI).

Downloaded SmartGit and moved the tarball gzip to my Home directory and upacked/extracted the files by double-clicking.

Ironically, since I selected SmartGit based on it having a GUI, after unpacking the file in my Home directory, I couldn’t figure out how to start/install the program (no GUI for that, I guess!). So, I took a look at the readme.txt file in the SmartGit folder. Here’s what it reads:

Installation

SmartGit itself does not need to be installed; just unpack it to your preferred
location and launch the bin/smartgit.sh script. It might be necessary to define
the SMARTGIT_JAVA_HOME environment variable pointing to the used Java home.

Well, this doesn’t seem like the best start for selecting a program that should make using easier, due to the existence of a GUI. I guess I’ll have to launch it the “old fashioned” way…

Change to the directory containing the smartgit.sh script:
$cd /smartgithg-6_0_5/bin

Launch SmartGit:
$./smartgithg.sh

SmartGit launched and here are the steps that I went through to get it configured:

1.See Git Executable location – Didn’t change anything.

Setup SmartGit-Hg _031

2.Select SSH Client – Didn’t change anything.

Setup SmartGit-Hg _032

3. Enter username/e-mail – Didn’t enter anything here.

Setup SmartGit-Hg _033

4a. Select a hosting provider for online repositories – I already have a GitHub account, so I selected that.

Setup SmartGit-Hg _034

4b. Selected GitHub…

Setup SmartGit-Hg _035

4c. Generated a GitHub API token on the GitHub website…

Authorized applications - Mozilla Firefox_037

4d. Continued API token stuff…

New personal access token - Mozilla Firefox_038

5.SmartGit detected “existing” local Git repositories – Not sure how/why these get detected as Git repositories, since I haven’t used them as such.

Setup SmartGit-Hg _039

6.New or existing repository – Selected to create a new repository.

Welcome to SmartGit-Hg _040

7.Weird message – I just hit “Initialize”

Add or Create Repository _041

Now, I want to make an alias so that I can launch the program without having to remember the location all the time. So, going back to my post on creating aliases in the .bash_aliases file, I’ll add the following to the .bash_aliases file so that I can easily launch SmartGit without having to remember where it is on my system:

alias smartgit=’/home/samb/smargithg-6_0_5/bin/smartgithg.sh’

Now, to launch SmartGit, all I have to type into Terminal is this:

$smartgit

Very nice!

Can’t update IPython

Well, been trying to get the IPython “nbconvert” command to run, to convert some IPython notebooks to html and/or slides. However, when I type this in Terminal:

samb@Mephisto:~$ ipython nbconvert

I get this output:

[TerminalIPythonApp] File not found: u'nbconvert'

This is weird because “nbconvert” is supposed to be built into IPython. Looking around the web, it seems as though “nbconvert” is only built in to IPython versions >1.0. Let’s check my version of IPython:

samb@Mephisto:~$ ipython --version
0.13.2

So, that explains it. I’m running v0.13.2. This is mildly irritating, as I just installed IPython a week ago. In fact, the latest stable version listed on the IPtyhon install page is 1.2.1 from February.

Selection_011

 

However, I can’t get IPython to update. When I try to use “apt-get”, this is what happens:

samb@Mephisto:~$ sudo apt-get install ipython-notebook
Reading package lists... Done
Building dependency tree
Reading state information... Done
ipython-notebook is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Sooooooo, now what?

I’m going to try to remove IPython via the Ubuntu Software Center.

OK, done.  To be safe, will reboot computer and then verify IPython removal has been completed.

After restarting, typing “ipython notebook” in to Terminal indicates that it is not installed and suggests I can get, and install, IPython by entering “sudo apt-get install ipython”.  However, I’m going to follow the instructions on the IPtyhon install page, which instructs the user to enter: sudo apt-get install ipython-notebook

This is how things turned out:

samb@Mephisto: ~_014

See that?  “Setting up ipython-notebook (0.13.2-2)…”  That’s the same version I had previously!  So, I guess I need to hunt down the more recent version.  At the bottom of the IPtyhon install page there is a link to the IPython Downloads Archive and this is what’s in it:

Selection_015

Lo and behold, the current version, which is MANY versions removed from the version that “apt-get” is retrieving.  Clicking on that link brings me to a page with a “tarball” (a file that ends with “.tar.gz”) and a ZIP file.

Downloaded the tarball http://archive.ipython.org/release/1.2.1/ipython-1.2.1.tar.gz by clicking on the link (I should learn how to do that in the command line).

Un-tarred and un-gzipped the file in Terminal:

samb@Mephisto:~/Downloads$ tar -xzf ipython-1.2.1.tar.gz

I then moved (using the GUI) the un-tarred and un-gzipped ipython-1.2.1 folder to my /home/samb directory and followed the installation directions for installing IPython from source.

The Terminal showed a bunch of stuff. Let’s see if using “nbconvert” does anything.

Result? Typing “ipython nbconvert” spits out a whole bunch of stuff; which is great!

I’ll launch IPython and see if it still sees my configuration file from the initial install/configuration last week.

Didn’t work! Launched IPython (ipython notebook) and this is what I got:

ImportError: No module named jinja2

Looking back at the installing IPython from source page, it doesn’t indicate that required dependencies are not installed by default. Maybe that’s always the case when installing packages from source when using Linux? I have no idea, but it would certainly be nice if the IPython instuctions indicated that, particularly since using “apt-get” doesn’t retrieve the most recent IPython build, thus potentially requiring people to download the source file.

Now that we’ve encountered this problem, I’m going to try to install IPython using “pip”. However, when I try running “pip” from Terminal, I’m informed that “pip” is not installed on the system. So, we’ll get it:

samb@Mephisto:~$ sudo apt-get install python-pip

Now, let’s run (as shown on the IPtyhon install page) :

samb@Mephisto:~$ pip install ipython[all]
Requirement already satisfied (use --upgrade to upgrade): ipython[all] in /usr/local/lib/python2.7/dist-packages
Installing extra requirements: 'all'
Cleaning up...
samb@Mephisto:~$ ipython --version
1.2.1

Not thrilled by the “Requirement already satisfied” output, since I uninstalled the last IPython (used the Ubuntu Software Center Package Manager). And, guess what. The notebook won’t launch and still spits out the error message about no jinja2 module. I’ll try restarting the computer and see if that helps.

And…

It did not help. I’m going to just delete the python2.7 directory found in /usr/local/lib, since that’s where all the IPython stuff seems to live. Deleted the directory:

samb@Mephisto:~$ sudo rm -rv /usr/local/lib/python2.7

rm = remove
-rv = recursively (r), verbose (v) to see all the files as they get deleted

Tried using “pip” again:

pip install ipython

It downloaded the ipython1.2.1 tarball, extracted stuff and then…

couldn’t write to the /usr/local/lib directory due to lack of permissions.

So, I re-ran the command with “sudo” and everything seems to have installed properly and completely. Trying to launch IPython notebook yields…

THE SAME JINJA2 module message!!!

Ahhhhh. Just realized I didn’t run:

sudo pip install ipython[all]

Totally forgot the “[all]”. Let’s try again.

Removed the python2.7 directory, as before. Ran sudo pip install ipython[all]. Ha! Well look at that! Here’s the end portion of the output from the that:

changing mode of /usr/local/bin/rstpep2html.py to 755
changing mode of /usr/local/bin/rst2latex.py to 755
changing mode of /usr/local/bin/rst2html.py to 755
Successfully installed ipython Sphinx pygments jinja2 nose docutils
Cleaning up...

Now, try to launch IPython and… Success!! I have finally managed to upgrade IPython! Not only that, but it has retained my previous configuration set up for the default notebook location. And, finally, test out if “nbconvert” is present. Yep! It’s there (just typed: ipython nbconvert)!

Here’s the quick summary of what I ended up having to do:

1. Had to delete the Python2.7 folder (located at /usr/local/bin).

2. Had to install “pip” (sudo apt-get install python-pip)

3. Used “pip” to retrieve and install most current version of IPython (sudo pip install ipython[all]

 

 

 

Use gksudo instead of sudo?

When using the “sudo gedit” command in Terminal to open my script “/etc/profile.d/myenvvars.sh”, I noticed I was getting the error message:

(gedit:2359): IBUS-WARNING **: The owner of /home/samb/.config/ibus/bus is not root!

The error message wasn’t preventing “gedit” from opening or anything; I just noticed that the Terminal had spit this out while I was editing my script file in “gedit”. So, curiosity got the best of me and I started to see if I could find a way to eliminate the messag.

After looking around the web, it seems that I should be using the “gksudo” command instead of regular old “sudo” when opening programs that have a graphical user interface (GUI).

So, let’s try opening the script above using “gedit” and “gksudo”.

samb@Mephisto://etc/profile.d$ gksudo gedit myenvvars.sh
The program 'gksudo' is currently not installed. You can install it by typing:
sudo apt-get install gksu

Well, it turns out that “gksudo” isn’t installed by default on this version of Ubuntu (13.10). However, it’s nice that the output tells you how to obtain “gksudo”. So, let’s try that out and try running “gksudo” again.

Using “gksudo” to run “gedit” works; no more warning message.

Installing and configuration of NCBI standalone BLAST

The Basic Local Alignment Search Tool (BLAST) is available to download for a variety of platforms here:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/

I snagged this one:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ncbi-blast-2.2.29+-x64-linux.tar.gz

Downloaded to my large Windows partition and extracted the files by double-clicking.

The primary “configuration” that I’m interested in is adding the BLAST directory (/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin) and the BLAST database directory (/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/dbs) to the Linux “PATH”.

One question is, why? What’s the point? Well, I guess those are two questions, but whatever.

The primary advantage to adding these two directories to the system PATH, is simply a matter of efficiency. To run BLAST in the current configuration, I have to type something like this (after the $):

Change to the proper directory:
samb@Mephisto:/$ cd /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin

Then, type out the necessary instructions to initiate BLAST and provide the location of the BLAST database:
samb@Mephisto:/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin$ ./blastn -db /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/dbs/RickettsiaGBnt20140228

By adding the BLAST and database directories to the system PATH, all I’d have to enter would be:

samb@Mephisto:/$ blastn -db RickettsiaGBnt20140228

Much cleaner and efficient. No changing directories, no lengthy directory paths.

So, let’s see if we can get that set up.

Tried to follow some instructions on the NCBI website: http://www.ncbi.nlm.nih.gov/books/NBK52640/

But, those instructions don’t tell you how to make a script to automatically append the BLAST and BLAST database locations to the system PATH so that you don’t have to amend the PATH each time you want to use BLAST! Lame!

Additionally, the instructions say that a “.ncbirc” file is required in the Home directory. Well, should the file have a name or do I just leave the file literally “.ncbirc”? Is it like a .htaccess file then? I guess I’ll just have to try it out. Ugh.

Anyway, here’s how I got it working so that I don’t have to change directories to the BLAST folder each time and I run BLAST and so I can just enter the name of a BLAST database without having to type out the full path of the database.

1. For dual boot systems, BLAST cannot be installed on the Windows partition. Linux can’t do the proper writing/executing of files on that partition due to a difference in partition formatting (Windows is NTFS).

2. Can’t simply move BLAST package from one location to a new one. It seems that the BLAST package needs to be re-installed in the user’s desired location. However, this could be an issue related to partition formatting, as I tried to simply move the BLAST folders from the Windows partition to the Linux partition. When I did this, couldn’t get BLAST to run, even though it was now on the Linux partition.

3. Created a script file in the /etc/profile.d folder called “myenvvars.sh” so that the locations of the BLAST executables and BLAST databases will be loaded into the system PATH upon logging in to the computer, as opposed to having to manually append the locations to the PATH each time I start the computer. Put this info in the myenvvars.sh file:
!#/bin/bash
export PATH=$PATH:/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin:
export BLASTDB=/home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/db

The “!#/bin/bash” identifies the file as a script file to the system. The other two lines “export” the variables (PATH and BLASTDB) so that they are available to use by the rest of system.

4. Created the “.ncbirc” file (called it blastdb.ncbirc) and put it in my computer’s “Home” folder. File contains this text:
[BLAST]
BLASTDB=/home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/dbs

5. Everything runs wonderfully!

I documented everything (including all failures, file locations changes, etc) in an IPython Notebook: InstallingBLAST.

Installing IPython

Installation instructions for IPython are here and it looks like using Linux has an advantage over the other two operating systems; no installation of extraneous software needed!

Just have to open Terminal and enter: sudo apt-get install ipython-notebook

Now, to test out if that worked. In Terminal: ipython notebook

Workspace 1_009

Cool, it’s up and running and I’m not sure it could have been any easier! Next IPython steps will be to configure the default save location for the IPython notebook files.

 

Installing Dropbox to a common location for both operating systems

I already have Dropbox installed Windows and don’t want a separate installation on my Linux partition taking up additional space (my SSD is 256GB, but that space is used up surprisingly quickly)

In theory, this should be straightforward; just install Dropbox on the Linux partition and point it at the Dropbox folder on my Windows partition.  However, some pre-installation Googling revealed that it’s not that easy. Followed the wonderful instructions on Gain Oloya’s blog.

Turns out, the very first step in the process doesn’t actually involve Dropbox at all!  I had to set up Ubuntu to automount my Windows partition, since Ubuntu doesn’t do this by default.  Otherwise, when the computer is started, Dropbox runs and can’t find the Dropbox folder because it exists on a partition that is inaccessible to Ubuntu (until that partition is accessed by the user).

Happily, there is a sort of graphical user interface (GUI) to add items/programs/commands to Ubuntu’s start up list: Startup Applications.  This is easily accessed by pressing the “Windows” key on the keyboard (or clicking the Ubuntu button in the sidebar) and searching for Startup Applications.

Once in Startup Applications, just press the “Add” button, enter a name and description for your application in the appropriate fields and then enter the following command in the “Command” field:

/usr/bin/udisks --mount /dev/disk/by-uuid/X

Replace the “X” in the above code with your Windows partition’s Universally Unique Identifier (UUID; a.k.a. drive label).  It’s probably worth restarting the computer at this point.

How do you find the UUID? There are a few ways:

  1. Right-click on the drive in Files (the file drawer icon on the Launcher), select “Properties” and the UUID will be listed under the “Basic” tab next to “Name.”

2.  If your drive is shown on the Launcher, click the drive icon to open that drive and the UUID will be listed at the top of the window:

B0FE4B1FFE4ADD6A_003

 

3.  Launch Terminal (can be found usingthe built-in search described earlier) and enter: sudo blkid
Enter your user password and you’ll get something like this:
samb@Mephisto: ~_004

Identify the correct drive and copy the UUID.

 

Now, finally, on to Dropbox!

Downloaded and installed Dropbox from the Ubuntu Software Center.

After installation completed (but before going through the Dropbox set up procedure), this window popped up:

Dropbox_Restart_Nautilus

It seems like I should press the “Restart Nautilus” button, but instead I pressed the “Next” button.  This initiated the Dropbox setup procedure.  I entered my account info and selected “Advanced Installation,” which allows you to select where to install the Dropbox folder on your system.  Navigated to the directory on my Windows partition where my current Dropbox folder exists; don’t navigate beyond this (i.e. into your existing Dropbox folder).  Dropbox notified me that there’s an existing Dropbox folder.  Just cruised through the rest of the setup wizard.  Dropbox started syncing and doing so without duplicating files!