- #1
- 10,295
- 41
Welcome to Java Class!
We're going to learn a bit of Java here, one bit at a time, using real world examples to understand what we're doing. My aim is that all of the Java posted here is executable, so you can try it yourself.
First, before you can make use of any Java programs, you'll need two things: a compiler and a runtime environment. The compiler essentially just converts your text source files into a stream of bytes that can be executed directly by a physical processor, which doesn't have too many smarts. You could open up a hex editor and type in the actual bytes, but that would be very, very difficult! That's why compilers exist: to convert a human-readable program into a dumb-machine-readable one. The human readable file is called source code, and the machine-readable translation is called object code.
The second part, the runtime environment, is specific to Java. Unlike other languages, your Java code is not compiled for a specific physical processor, like a PowerPC G5 or a Pentium III. Instead, your Java code is compiled to neutral bytecode. This neutral bytecode resembles the PowerPC G5 and Pentium III instruction sets, but is not run directly. Instead, the bytecode is executed by a program that "pretends" to be a physical processor -- it's called a virtual machine.
Okay, so where do you get these programs? Here: http://java.sun.com/j2ee/1.4/download.html
You want the Java J2SE 1.4.2 SDK (Java 2, Standard Edition, version 1.4.2, Software Development Kit). The filename, if you're on Windows, is j2sdk-1_4_2_04-windows-i586-p.exe.
So, download and install that. When you're done, we'll be ready to compile and run our first program.
- Warren
We're going to learn a bit of Java here, one bit at a time, using real world examples to understand what we're doing. My aim is that all of the Java posted here is executable, so you can try it yourself.
First, before you can make use of any Java programs, you'll need two things: a compiler and a runtime environment. The compiler essentially just converts your text source files into a stream of bytes that can be executed directly by a physical processor, which doesn't have too many smarts. You could open up a hex editor and type in the actual bytes, but that would be very, very difficult! That's why compilers exist: to convert a human-readable program into a dumb-machine-readable one. The human readable file is called source code, and the machine-readable translation is called object code.
The second part, the runtime environment, is specific to Java. Unlike other languages, your Java code is not compiled for a specific physical processor, like a PowerPC G5 or a Pentium III. Instead, your Java code is compiled to neutral bytecode. This neutral bytecode resembles the PowerPC G5 and Pentium III instruction sets, but is not run directly. Instead, the bytecode is executed by a program that "pretends" to be a physical processor -- it's called a virtual machine.
Okay, so where do you get these programs? Here: http://java.sun.com/j2ee/1.4/download.html
You want the Java J2SE 1.4.2 SDK (Java 2, Standard Edition, version 1.4.2, Software Development Kit). The filename, if you're on Windows, is j2sdk-1_4_2_04-windows-i586-p.exe.
So, download and install that. When you're done, we'll be ready to compile and run our first program.
- Warren