Install Java compiler
|
|
|
|
| Articles Reviews Java | |
| Written by Bogdan V | |
| Friday, 17 November 2006 | |
|
{mos_sb_discuss:34}
The Java compiler is part of the Java Software Development Kit (SDK), formerly known as the Java Development Kit (JDK). The Java interpreter and JVM are part of the Java Run-time Environment (JRE). Both the Java SDK and JRE for various hardware platforms are available as a free download from http://java.sun.com. Even if you have the Java compiler and run-time environment available, Sun’s Java web site contains a wealth of information including the entire API specification for each release, tutorials and tools to assist in developing Java programs, and sample programs.
2EE, J2SE, and J2ME Platforms When selecting the version of the Java SDK to download, you need to choose between the J2EE, J2SE, and J2ME platforms. Each of these three editions contains a different set of packages, or APIs, to develop Java programs. The first two characters, “J2,” stand for Java platform 2, which includes versions 1.2 and later of the Java SDK, and the fourth character, “E,” simply stands for Edition. The third character, “E,” “S,” or “M,” determines which libraries the download includes. J2EE is the Enterprise Edition that contains the most libraries, and supports building enterprise- class server-side applications. J2SE is the Standard Edition that contains the tools to develop Java applets and applications. J2ME is the Micro Edition that contains a highly optimized run-time environment for deploying applications to consumer products such as cellular phones, Personal Digital Assistants (PDAs), and car navigation systems. If you are unsure which platform to choose, select the J2SE platform as it contains all of the tools you need to start learning Java. Installing and Testing the Installation Installing the Java SDK is as simple as running the downloaded executable file and following the installation prompts for both Windows and Unix platforms. For Unix platforms, first turn on the executable bit using the chmod +x command before running the downloaded executable file, and upon the completion of the installation, add the <INSTALL>/bin directory to your class path. The class path is an environment variable named CLASSPATH where Java programs search for dependent objects. For Unix installations, the class path is typically set in a run code script such as .profile or .cshrc, and for Windows installations the class path is set using the System Properties within the Control Panel. public class Hello { At a command prompt, compile the program into Java bytecodes using the Java compiler javac. prompt> javac Hello.java
prompt> java Hello
prompt> java –version
Integrated Development Environments As shown in the installation test, all that you need to develop and compile a Java program is a text editor and the Java compiler. Once you become comfortable developing Java applications, you will most likely want to use an Integrated Development Environment (IDE) to simplify program development. IDEs provide useful features such as syntax highlighting, quick access to different source files, wizards to create template code for common program types, an interactive debugger, and source code control. IDEs will even point out errors in your program, such as not catching exceptions or mismatched braces, before you attempt to compile the program. Powered by jReviews |
|
| Last Updated ( Saturday, 07 July 2007 ) | |
| < Prev | Next > |
|---|







