next up previous
Next: Learning the Language Up: Introduction Previous: Java vs.English

Write, Compile, Run

The sequence of events in programming is the following:

  1. Write the program, using a text editor of some kind.
  2. Compile the program, using a Java compiler (such as javac)
  3. Run the compiled code on a JVM (Java Virtual Machine)

We've talked a bit about compiling - the translation between Java and the machine's language - but we haven't talked about how the compiler works, what the JVM is, or about the computer hardware (the physical construction of the computer). As far as the compiler goes, we'll learn bits and pieces about it as we go through the course, but only in as much depth as we need to in order to be decent programmers. You'll have to wait until 4th year in order to find out the details about compilers.

The JVM is yet another program, and its job is to simulate the computer. This is how compiled Java programs can run on computers with different hardware: the compiled program tells the JVM what to do, and the JVM tells the computer's hardware what to do. Of course this means that each different type of computer such as a Macintosh, or a SUN, and so on has to have a JVM just for that type of computer since the JVM has to 'know' about the hardware. However, the compiled Java program should run on any of these computers. Again, we won't spend much time talking about the JVM or the hardware, and when we do, we won't do so in much depth.

It turns out that people have created tools (yes, programs again) to help you in these tasks. One of the most powerful tools is an IDE (Integrated Debugging Environment) which combines an editor, a compiler, a JVM, and other tools such as a debugger, version control, and so on. In this course we'll use the Code Warrior IDE.

It turns out that the best programmers understand the workings of the compiler, the JVM, and the hardware in great detail, and perhaps in time you will as well. For now our goal is to get you programming in Java so we'll minimize the amount of detail about these other topics and concentrate on the language and what it does. However, in order to understand what the language does we need to deal with some of these other topics a little, but we'll try to keep it simple. In fact, we may tell you things that aren't quite true in order to simplify things a bit; in time you'll flesh out the details and find out that what we tell you is certainly true in spirit if not in detail.


next up previous
Next: Learning the Language Up: Introduction Previous: Java vs.English
Chris Trendall
Copyright ©Chris Trendall, 2001. All rights reserved.

2001-12-09