1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Brew Your First Cup of Java on Unix

Instructions for programming a simple Java application on Unix

By

Great Things about Java

Java is an operating system independent platform for software development. It consists of a programming language, utility programs and a run time environment. A Java program can be developed on one computer and run on any other computer with the correct run time environment. In general, older Java programs can run on newer run time environments. Java is rich enough that even very complicated applications can be written without operating system dependencies. This is called 100% java.

With the development of the internet Java has gained in popularity, because when you program for the Web, you have no way of knowing which system the user may be on. With the Java programming language, you can take advantage of the "write once, run anywhere" paradigm. This means that when you compile your Java program, you don't generate instructions for one specific platform. Instead, you generate Java byte code, that is, instructions for the Java Virtual Machine (Java VM). For the users, it doesn’t matter what platform they use--Windows, Unix, MacOS, or an Internet browser—as long as it has the Java VM, it understands those byte codes.

Three Types of Java Programs

- An "applet" is a Java program designed to be embedded on a web page.
- A "servlet" is a Java program designed to be run on a server.

In these two cases the Java program cannot be run without the services of either a Web browser for an applet or a Web server for a servlet.

- A "Java application" is a Java program that can be run by itself.

The following instructions are for you to program a Java application using a Unix-based computer.

A Checklist

Very simple, you need only two items to write a Java program:

(1) The Java 2 Platform, Standard Edition (J2SE), formerly known as the Java Development Kit (JDK).
Download the latest version for Linux. Make sure you download the SDK, not the JRE (the JRE is included in the SDK/J2SE).

(2) A text editor
Almost any editor you find on Unix-based platforms will do (e.g., Vi, Emacs, Pico). We’ll use Pico as an example.

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.