Installing Haskell plugin for Eclipse
I use Eclipse for all sorts of development in C, Java and Haskell. It
gives me uniform look and feel on every project. This is updated post
with instructions for installing Haskell plugin for Eclipse.
This time I am installing on Windows XP (and Ubuntu 9.10 after) machine.
We need the following software installed (and versions i am installing):
- Eclipse (3.5.1) +Java (1.6)
- EclipseFP plugin (1.108.0)
I have no success to run Wink on Ubuntu 9.10 (it seems to work on 8.10) so no screencast just instructions for now.
- First if you don×.t have GHC installed install it ×.sudo apt-get
install ghc×.. There is still no GHC 6.10 version for Ubuntu so i am
installing it manually.
- go to ×.http://haskell.org/ghc/×. Binary Packages->Linux (x86)
- get ×.ghc-6.10.4-i386-unknown-linux-n.tar.bz2×¦
- ×.tar jxvf ghc-6.10.4-i386-unknown-linux-n.tar.bz2×¦
- ×.cd ghc-6.10.4/×.
- ×../configure ×.prefix=/home/ross/ghc×. ×. here i put installation in
custom location in my HOME directory. If you want this to be installed
on standard location skip ×.×.prefix×. and run as ×.sudo×.. Also skip next
- make install
- Now extend PATH environment variable to this custom location. ×.vi
~/.bashrc×. add ×.PATH=$PATH:/home/ross/ghc/bin×. and ×.export PATH×.
- If you want GHC 6.8 just skip previous steps and ×.sudo apt-get install ghc×.
- get Cabal ×.http://www.haskell.org/cabal/download.html×. ×.cabal-install-0.6.2.tar.gz×.
- ×.tar zxvf cabal-install-0.6.2.tar.gz×. ×. extract archive
- ×.cd cabal-install-0.6.2/×.
- ×../bootstrap.sh×. ×. here installation stops with some missing library
like ×./usr/bin/ld: cannot find -lgmp×.. The reason is that you need not
only library (in this case Multiprecision Arithmetic Library) but also
development version of it. Install development version ×.sudo apt-get
install libgmp3-dev×. and run ×../bootstrap.sh×. again. If all dependencies
are resolved ×.cabal×. is installed in you HOME directory for example
- Run cabal to update and to install Scion ×.~/.cabal/bin/cabal update×.
×.~/.cabal/bin/cabal install scion×.. There are some warnings during the
installation. Lets hope they aren×.t important ones.
- Install eclipse if not already installed ×.sudo apt-get install eclipse×.
- Run and choose ×.workspace×. location.
- Go to ×.Help->install new software×.
- ×.add×. and enter name ×.GHC 6.10×¦ and location ×.http://eclipsefp.sf.net/updates×.
- Expand list of plugins and select new version of the plugin ×.1.108.0×¦ (this version uses Scion). Install it.
- go to ×.Window->Preferences->Haskell->Haskell
Implementations×.. Add name ×.GHC 6.10×¦ and executable folder
×./home/ross/ghc/bin×.. In this case my custom installation location.
- Go to Scion section ×.autodetect×.. It detects the scion server at ×./home/ross/.cabal/bin/scion-server×.. ×.apply×. options.
- Change default Java to ×.Haskell×. perspective at the right top corner of Eclipse. ×.click->other..->Haskell×.
Now lets create simple Haskell project to test the installation.
- ×.file->new->Project->Haskell Project×.
- project name ×.Hello×.
- Expand created project and right click on ×.src×. directory
×.new->haskell module×.. Source folder is set to ×./Hello/src×.. Enter
module name ×.Main×..
- in ×.Main.hs×. file enter ×.module Main where×. next ×.mian = putStrLn
×.Hello World!×.. Save and click on green button ×.Run As->Run GHCi
session×.. Next time you run it there should be ×.Main×. item in ×.Run×.
- Type ×.main×. in console tab. Now you should see ×.Hello World!×. written to console.
Enjoy happy programming.