Novell is now a part of Micro Focus

Eclipse - More than Just a Compiler - Part 1

Novell Cool Solutions: Feature
By Jeff Fischer

Digg This - Slashdot This

Posted: 31 Mar 2004
 

Introduction

In this article, I will begin a series about the Eclipse development environment. This series could be titled Setting Up a Novell Development Environment with Eclipse, but I was so excited about Eclipse that I thought I would go into more detail about the platform and even some Eclipse development.

I will begin this series and this article by talking about some of the history about Eclipse. Then, I will talk about the features of Eclipse as a Java compiler/IDE and how to use them as well as many of the plugins for the Eclipse development platform. Next, I will detail a little about the architecture about Eclipse and what makes Eclipse more than just an IDE. I will also show how to setup the Eclipse environment and use the Novell NDK Java libraries to develop Novell centered applications with Eclipse. My hope is that after reading this series that you will see as I do now that the Eclipse project is more than just a compiler and an Integrated Development Environment.

Setup

Just a reminder about my setup. I have SUSE Linux 9.0 Professional installed on my laptop where I do all my development. I am using the KDE desktop environment. I don't have any particular tie to using KDE specifically yet, but I wanted to compare using KDE to using Ximian Desktop 2. SUSE 9.0 comes installed with OpenOffice 1.1, which is what I am using to write all of my articles. I am using Gimp 1.3 for all my image editing and screen shots. I have a complete Linux environment that I use and enjoy using and have all the tools I need.

Just a Little Eclipse History

Eclipse is a project started several years ago by IBM. They contributed a large portion of the code and began to develop a Java IDE. The project has been open source and continues to grow with participation from other major companies in the industry now. IBM recently separated the Eclipse project into its own organization with its own Board of Directors managing the project. While IBM does have a few people that sit on the Board for Eclipse, they have invited several other vendors and people from around the world to sit on the board and help run and manage the future development of Eclipse. On the Eclipse web site, you can see who is involved in the project. Now, Eclipse is a separate organization with world wide leadership, developing an open source Integrated Development Environment with participation from software companies around the industry.

While not everyone has participation at the Board of Directors level, dozens of companies have joined the Eclipse project to further the development of the environment. Novell is one company who recently announce their support for Eclipse. We have announced that we are joining the Eclipse community and we will use the environment for development and contribute code to the project as well.

I'm sure that I'm not alone when I say that learning a new IDE is not a fun task. It is hard for a programmer to leave his comfortable environment for a new one. I'll admit that it was hard for me to make a change from my coveted JBuilder IDE to Eclipse, but I have enjoyed the switch. There are many features of Eclipse that I'll talk about next that help people like me that have been using commercial IDE's switch to an Open Source environment.

The Eclipse web site is located at http://www.eclipse.org. There you can learn about the Eclipse projects, the organization, download Eclipse, and its documentation as well as view who is involved in the project.

What is the Eclipse Project?

The Eclipse Integrated Development Environment actually is a combination of dozens of projects. I'll discuss this in a later article, but the architecture of Eclipse has been developed to be a framework. It is a extensible framework that allows for programmers to develop their own set of tools that provide functionality for the environment. This follows the paradigm of the Open Source development model. Eclipse has been developed so that each piece of functionality can be developed as a side project and easily plugged into the Eclipse framework to extend the functionality of the IDE.

There are actually 4 main project headings that comprise the Eclipse project. They are:

The Eclipse Project
The Eclipse Tools Project
The Eclipse Technology Project
The Eclipse Web Tools Platform Project

I'll go into more detail about each of the main projects in a later article. For today, let's just get Eclipse installed.

Installing Eclipse

Eclipse runs on basically any platform that you will use for development. Eclipse builds exist for Windows, Linux, Unix and Macintosh, or you can build directly from source code if you desire. You can choose your build of Eclipse for your platform at the Eclipse downloads web site at http://www.eclipse.org/downloads/index.php.

As of this writing, Eclipse version 2.1 is the latest full release. Although version 3.0 has release candidates available. I downloaded version 2.1 for Linux. Follow the steps below to download and install Eclipse.

  1. First, you must have a JRE installed on your machine. Eclipse does not include a JRE with the download. I downloaded the JDK from Sun at http://java.sun.com . Once you have downloaded the RPM file, you change the permission and unpack it. Type chmod +x j2sdk-1_4_2_03-linux-i586-rpm.bin.
  2. Run the BIN file to extract it by typing ./j2sdk-1_4_2_03-linux-i586-rpm.bin.
  3. Scroll down using the space bar and type yes to agree to the license. Now you can install the package.
  4. Type rpm -i j2sdk-1_4_2_03-linux-i586-rpm.
  5. To add the JDK path to your PATH variable, open a console window and type su - to become the root user.
  6. Type in your password.
  7. Type vi /etc/profile.
  8. Add the location of your JDK to your path statement. It should be something similar to /usr/java/j2sdk1.4.2_03/bin.
  9. Type source /etc/profile.
  10. Type javac at the console window and you should see the following output:
    Usage: javac <options> <source files>where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path>       Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options
  11. If you see the following output, then you know your path statement includes the location of the JDK you just downloaded.
  12. Go to http://www.eclipse.org/downloads/index.php.
  13. Click on the link for latest release 2.1.2.
  14. Click on the link to download the Eclipse download file for either Motif or GTK, depending on which one you are using.
  15. Save the file to you machine.
  16. Open a console windows and type unzip eclipse-SDK-2.1-linux-motif.zip.
  17. Eclipse will be extracted to a directory called eclipse.
  18. Change to the eclipse directory and type ./eclipse to start the Eclipse Workbench.

Novell Development Environment

Now that you have Eclipse installed on your Linux machine, you are ready to setup your Novell Development libraries to begin developing applications with Novell technologies. The Novell Developer web site is http://developer.novell.com.

At this web site, you can find information you need to develop your applications with Novell technologies. You can download components of the Novell Developer Kit such as libraries, documentation, and articles.

If you go to http://developer.novell.com/ndk/downloadaz.htm, you can view all the components of the NDK. You can choose to download or view information about each component. You can select any component to download it. For example, if you want to begin developing Java web applications that access information in eDirectory, you might want to download the LDAP command beans. Here's how to download the LDAP command beans and install the library into Eclipse.

  1. Click on the link Beans for Novell Services on the A-Z download page.
  2. Click on the link for LDAP Command beans.
  3. Click on the link to download all the components of LDAP Command beans.
  4. You will be prompted to login. You will need to create a login username to download from the NDK.
  5. After you login, you will see a link to download the component in a .exe, .zip, or .tar.gz format.
  6. Choose the .tar.gz format if you are using Linux.
  7. Save the file to you machine.
  8. Open a console window.
  9. Type tar xvzf bns_ldapcmd_all.2004.01.27.tar.gz to extract the contents of the archive to a directory.
  10. Open Eclipse.
  11. Select File > New > Project.
  12. Select Java > Java Project and click Next.
  13. Type in a name for the project and click Next.
  14. Click the Libraries tab.
  15. Click the Add External Jars... button.
  16. Browse to and select the JAR files you just extracted in the archive. They are in the bns_ldapcmd_all.2004.01.27/beans/bns_ldapcmd/lib directory.
  17. Click Finish to create the project.
  18. Add an import statement com.novell.ecb.* to test and make sure that the Novell libraries you just downloaded are linked into your new Java project. You should now be ready to start developing applications with Eclipse.

In this article, we briefly discussed the Eclipse project and how to setup Novell libraries with Eclipse. Next month, I'll give a more detailed discussion about the architecture of Eclipse, features of the IDE, and plugins for the environment, as well as show some Novell code.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© Micro Focus