This site may be down for up to an hour for network maintenance during the period
21 January 2022 22:30 UTC - 22 January 2022 00:30 UTC.

Difference between revisions of "Downloading, installing and configuring ''Eclipse''"

From The SBN Wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''Eclipse'' is an open-source, extendable development environment that supports an XML-aware editor. It is free for non-commercial use. It can be useful for creating, editing, and doing basic validation of XML document and XML Schema documents.
+
[[Category:Eclipse]]
 +
''Eclipse'' is an open-source development environment framework that underlies several commercial products (the IDL IDE and oXygen editor being two of the better-known examples). It's available for free (for non-commercial use) for all the major platforms. It does support a basic and useful XML-aware editor.
 +
 
  
 
This page describes the process of downloading and installing the Eclipse editor on a Windows 7 machine.  Other platforms follow similar procedures, with differences in the details.  If you happen to know the details for a platform not already mentioned below, please do add them.
 
This page describes the process of downloading and installing the Eclipse editor on a Windows 7 machine.  Other platforms follow similar procedures, with differences in the details.  If you happen to know the details for a platform not already mentioned below, please do add them.
Line 15: Line 17:
 
* http://www.eclipse.org/downloads/
 
* http://www.eclipse.org/downloads/
  
You will be offered both 32- and 64-bit versions.  Regardless of what your system CPU actually is, ''you '''must''' download the version that is compatible with your JRE.''  My Windows 7 machine, for example, is a 64-bit machine running a 64-bit version of Windows, but the JRE is only 32 bits. Attempting to run the 64-bit version of Eclipse yields this error:
+
You will be offered both 32- and 64-bit versions.  Regardless of what your system CPU actually is, ''you '''must''' download the version that is compatible with your JRE.''  My Windows 7 machine, for example, is a 64-bit machine running a 64-bit version of Windows, but the JRE is only 32 bits. Attempting to run the 64-bit version of Eclipse yields this error:
  
 
[[File:64bitMissingError.png|center]]
 
[[File:64bitMissingError.png|center]]
  
 
(There are other solutions to this particular problem - adjusting which ''Eclipse'' version you download is probably the easiest.)
 
(There are other solutions to this particular problem - adjusting which ''Eclipse'' version you download is probably the easiest.)
 +
 +
As another example, Stef's desktop computer is a 64-bit machine running Scientific Linux, and the distributed JRE is 64-bit.  (Type "java -version" to check at your Linux command prompt.)  The 64-bit version of Eclipse works well for that platform.
  
 
== Unzip the File and Install ==
 
== Unzip the File and Install ==
Line 25: Line 29:
 
Unzip the file to create the ''Eclipse'' installation directory tree. ([[Windows unzipping problem]])
 
Unzip the file to create the ''Eclipse'' installation directory tree. ([[Windows unzipping problem]])
  
Installation consists of moving that directory tree to some convenient location, where "convenient" depends on you OS and how you prefer to work.  On a Linux machine, you're going to want the '''eclipse''' executable in your path. On my Windows machine, a created an ''eclipse'' directory under my user directory and added a shortcut on my desktop for the "eclipse" application file. The first time you run ''eclipse'' you will have to specify a place to hold your output files, e.g., the XML and schema files you'll be creating.   
+
Installation consists of moving that directory tree to some convenient location, where "convenient" depends on your OS and how you prefer to work.  On a Linux machine, you're going to want the '''eclipse''' executable in your path. On my Windows machine, I created an ''eclipse'' directory under my user directory and added a shortcut on my desktop for the "eclipse" application file. The first time you run ''eclipse'' you will have to specify a place to hold your output files - in our case, the XML and schema files you'll be creating.   
  
 
If you've never used an IDE before, now would be an excellent time to look over the "Workbench basics" information available via the "Welcome" icon on the ''eclipse'' splash screen.
 
If you've never used an IDE before, now would be an excellent time to look over the "Workbench basics" information available via the "Welcome" icon on the ''eclipse'' splash screen.
 +
 +
=== Installing the Schematron Plugin ===
 +
 +
PDS4 uses Schematron files - a special form of XML schema file, to specify detailed dependency and co-dependency information for various attributes.  ''Eclipse'' does not come configured to do work with Schematron files, so we'll have to install a plugin to get minimal capability for this.
 +
 +
There's really only one plug-in available.  It is based on a jar file available from Sourceforge, developed by Castle Designs.  Eclipse does have a software manager installed, so start by locating the "Install software" option in the Help menu and clicking it:
 +
 +
[[File:InstallSoftwareLocation.png|center]]
 +
 +
This will take you to a screen where you can specify new places to look for Eclipse modules.  You can also browse the standard repositories, but the Schematron plugin isn't in there - so click on the "'''Add...'''" button and you'll get a pop-up dialogue to enter an new repository URL:
 +
 +
[[File:AddRepositoryDialogue.png|center]]
 +
 +
The home page for the plugin is http://castledesigns.co.uk/schematron-ep.html
 +
 +
The URL to the actual repository is:
 +
 +
:::<pre>http://www.castledesigns.co.uk/schematron-ep/site.xml</pre>
 +
 +
Once you've typed it in, click on "'''OK'''" and the installation should proceed without further input (although on some systems, like my Windows 7 system, you may get warning boxes about unknown software to click through).
 +
 +
=== Other Plugins ===
 +
 +
Once you've gotten a feel for how the basic ''eclipse'' interface works, it's worth browsing through the available plugins in the standard repositories.  You may find something that will make your editing life easier.  If you do, let us know...
 +
 +
== Configuring Eclipse ==
 +
 +
There are many configurable behaviors in ''eclipse''.  This section describes the settings that are either essential or really, really useful for PDS4 XML work.
 +
 +
=== Setting Program Preferences ===
 +
 +
The ''eclipse'' '''Preferences''' menu is under the '''Window''' menu, along the top of the application window:
 +
 +
[[File:PreferencesLocation.png|center]]
 +
 +
==== Schematron Preferences ====
 +
 +
Since you went to the trouble of installing the Schematron plugin, now would be a good time to turn on Schematron debugging:
 +
 +
[[File:SchematronPreferences.png|center]]
 +
 +
Schematron validation is ''not'' set in the '''Preferences''' menus, but rather in the project context menu (see [[Configuring XML Schema validation]])
 +
 +
==== Validation Preferences ====
 +
 +
The default validation preferences are a pretty good starting point.  You may want to select a couple of these check boxes depending on how much you are annoyed by certain warnings that will pop up while you're working.
 +
 +
[[File:ValidationPreferences.png|center]]
 +
 +
==== XML Preferences ====
 +
 +
There are several sub-sections for XML and XML schema options.  The defaults are good enough to start with.  I've checked "Enable markup validation" because I'd like to validate the syntax as I work on the XML files.
 +
 +
[[File:XMLValidationPreferences.png|center]]
 +
 +
The '''XML Catalog''' settings are very important, but you need to have specific data in mind to set these properly (see [[MyFirstSchemas]]).
 +
 +
=== Changing Perspectives ===
 +
 +
The general layout of the ''eclipse'' windows can be customized to a pretty high degree.  There are several basic layouts designed for specific tasks that are good starting points.  These are called ''perspectives''.  The default perspective for the ''eclipse'' spin we've installed is for Java development, but the package includes a perspective that is more congenial to  XML work.  To switch to it, click on the little ''Open perspective'' icon in the upper right corner:
 +
 +
[[File:OpenPerspectiveLocation.png|center]]
 +
 +
Select "XML" from the pop-up dialogue box and click "'''OK'''":
 +
 +
[[File:OpenPerspectiveDialogue.png|center]]
 +
 +
This will re-arrange the layout of the ''eclipse'' workspace and add a button to the upper right to make it easier to switch back to the XML perspective in future.

Latest revision as of 17:46, 2 July 2014

Eclipse is an open-source development environment framework that underlies several commercial products (the IDL IDE and oXygen editor being two of the better-known examples). It's available for free (for non-commercial use) for all the major platforms. It does support a basic and useful XML-aware editor.


This page describes the process of downloading and installing the Eclipse editor on a Windows 7 machine. Other platforms follow similar procedures, with differences in the details. If you happen to know the details for a platform not already mentioned below, please do add them.

Note that all versions of Eclipse require the Java Runtime Environment (JRE), version 1.6 or better. Unless you're working on a machine more than about 3 years old that is not kept updated and patched, you likely will have this available to you.

Downloading the Right Package

The bare Eclipse editor doesn't provide much other than a framework to plug modules into. Unless you like rolling your own from scratch, you'll want one of the pre-packaged spins. The one that has most of what we want installed is called "Eclipse IDE for Java Developers" (not the one "for Java EE Developers"). Here's what the right download bar looks like for my Windows download:

EclipseIDEforJavaDevelopersBar.png

You can download it from this page:

You will be offered both 32- and 64-bit versions. Regardless of what your system CPU actually is, you must download the version that is compatible with your JRE. My Windows 7 machine, for example, is a 64-bit machine running a 64-bit version of Windows, but the JRE is only 32 bits. Attempting to run the 64-bit version of Eclipse yields this error:

64bitMissingError.png

(There are other solutions to this particular problem - adjusting which Eclipse version you download is probably the easiest.)

As another example, Stef's desktop computer is a 64-bit machine running Scientific Linux, and the distributed JRE is 64-bit. (Type "java -version" to check at your Linux command prompt.) The 64-bit version of Eclipse works well for that platform.

Unzip the File and Install

Unzip the file to create the Eclipse installation directory tree. (Windows unzipping problem)

Installation consists of moving that directory tree to some convenient location, where "convenient" depends on your OS and how you prefer to work. On a Linux machine, you're going to want the eclipse executable in your path. On my Windows machine, I created an eclipse directory under my user directory and added a shortcut on my desktop for the "eclipse" application file. The first time you run eclipse you will have to specify a place to hold your output files - in our case, the XML and schema files you'll be creating.

If you've never used an IDE before, now would be an excellent time to look over the "Workbench basics" information available via the "Welcome" icon on the eclipse splash screen.

Installing the Schematron Plugin

PDS4 uses Schematron files - a special form of XML schema file, to specify detailed dependency and co-dependency information for various attributes. Eclipse does not come configured to do work with Schematron files, so we'll have to install a plugin to get minimal capability for this.

There's really only one plug-in available. It is based on a jar file available from Sourceforge, developed by Castle Designs. Eclipse does have a software manager installed, so start by locating the "Install software" option in the Help menu and clicking it:

InstallSoftwareLocation.png

This will take you to a screen where you can specify new places to look for Eclipse modules. You can also browse the standard repositories, but the Schematron plugin isn't in there - so click on the "Add..." button and you'll get a pop-up dialogue to enter an new repository URL:

AddRepositoryDialogue.png

The home page for the plugin is http://castledesigns.co.uk/schematron-ep.html

The URL to the actual repository is:

http://www.castledesigns.co.uk/schematron-ep/site.xml

Once you've typed it in, click on "OK" and the installation should proceed without further input (although on some systems, like my Windows 7 system, you may get warning boxes about unknown software to click through).

Other Plugins

Once you've gotten a feel for how the basic eclipse interface works, it's worth browsing through the available plugins in the standard repositories. You may find something that will make your editing life easier. If you do, let us know...

Configuring Eclipse

There are many configurable behaviors in eclipse. This section describes the settings that are either essential or really, really useful for PDS4 XML work.

Setting Program Preferences

The eclipse Preferences menu is under the Window menu, along the top of the application window:

PreferencesLocation.png

Schematron Preferences

Since you went to the trouble of installing the Schematron plugin, now would be a good time to turn on Schematron debugging:

SchematronPreferences.png

Schematron validation is not set in the Preferences menus, but rather in the project context menu (see Configuring XML Schema validation)

Validation Preferences

The default validation preferences are a pretty good starting point. You may want to select a couple of these check boxes depending on how much you are annoyed by certain warnings that will pop up while you're working.

ValidationPreferences.png

XML Preferences

There are several sub-sections for XML and XML schema options. The defaults are good enough to start with. I've checked "Enable markup validation" because I'd like to validate the syntax as I work on the XML files.

XMLValidationPreferences.png

The XML Catalog settings are very important, but you need to have specific data in mind to set these properly (see MyFirstSchemas).

Changing Perspectives

The general layout of the eclipse windows can be customized to a pretty high degree. There are several basic layouts designed for specific tasks that are good starting points. These are called perspectives. The default perspective for the eclipse spin we've installed is for Java development, but the package includes a perspective that is more congenial to XML work. To switch to it, click on the little Open perspective icon in the upper right corner:

OpenPerspectiveLocation.png

Select "XML" from the pop-up dialogue box and click "OK":

OpenPerspectiveDialogue.png

This will re-arrange the layout of the eclipse workspace and add a button to the upper right to make it easier to switch back to the XML perspective in future.