An IDE, Integrated Development Environment, is a software package that facilitates the creation, maintenance and running of a software program. IDE's come with a context-sensitive editor that will auto-indent and colorize code to improve readability and offers <TAB> completion to identify functions and variables; a browser to manage source code files and libraries; they compile code dinamically; they allow the user to run the program and offer a debugger.
Downloading and Installing
- NetBeans can be downloaded here. For this course chose the Java SE version. The download page has a link to detailed installation instructions.
- Eclipse can be downloaded here. For this course chose Eclipse Classic. You can find more installation instructions here.
Different IDE's will have slightly different look and feel, different shortcuts and will offer different extension plugins, but the general workings are the same. To start coding a new program you need to create a new project and a new file. A project contains all of the packages and files necessary to execute a program.
- NetBeans: Click on File > New Project to bring up a window. For a standard java program (like the ones you'll be writing in this class), make sure the "Java" category and the "Java Application" project are highlighted. Click "Next" and name the project. The default settings for everything else are fine. Click "Finish" to bring up a template of a program.
- Eclipse: Click on File > New > Java Project to bring up a new window. Name the project and click "Finish". Create a new file by clicking on File > New > Class. Name the file, make sure that "public static main(String args)" is selected and click "Finish".
The template consists of the package (project) you just created and named, a Main class which will encapsulate the
program, and a main method which will contain all the executable statements. To verify you have installed everything
properly, you should run a test program. For example, write the following line where it says
// TODO ....:
System.out.println("This is my first Java program !");
The code is compiled dynamically as you write it, so to execute your program simply click Run > Run Project or click the green arrow icon. Congratulations! You've just written your first Java program!More documentation
Java comes with an extensive publicly available library. It includes classes to handle basic I/O, wrapper classes for basic types like Integer and String and classes for graphics.
You can see a list with details and explanation of each class online by consulting the Java API (Application Program Interface).
Javadoc is a documentation generator for generating API documentation in HTML format from Java source code. The HTML format is used to add the convenience of being able to hyperlink related documents together.
Javadoc How-To documentation can be found here.
Processing is an open programming language and environment to create images, animations and interactions.
A full description with documentation, examples and tutorials can be found at processing.org. On that page you can find the link to download the latest version for your operating system.Downloading and start using
After downloading and installing the software you can run the Processing program directly. This will open up an empty sketch pad where you can write your program.
Examples in the
File menu, you will get a window with an extensive
list of example programs. Clicking on any of the programs will open a sketch pad window with the source code. Using the
arrow button on the top-left-hand of the window frame you can run the program.
The web site openprocessing.org is a vast repository of processing
collections links at the top of the page help you navigate
Fair warning: you might end up spending many sleepless nights playing with all the available programs !
You can develop and run programs from within your IDE's, with some caveats.
- Eclipse: use the proclipsing plugin. To download, install and start using proclipsing see the Wiki/GettingStarted page of http://code.google.com/p/proclipsing. Most Processing programs work fine within proclipsing, but for programs that involve video capture you will need my help.
- NetBeans: there is a basic plugin for NetBeans that you can find in the Installation page of http://code.google.com/p/netbeans-processing-template. The NetBeans template is not nearly as complete as Proclipsing and might force you to do quite a bit of setup by hand.