Java Programming/Installation
From Wikibooks, the open-content textbooks collection
To formally begin programming in Java, you would need to obtain the Java software necessary and install it on your system. This section will help you set up any system with the latest Java software.
Contents |
[edit] Obtaining Java software
For now, a text editor should be the least of your worries. What matters the most is to get your hands on the two main components required for Java programming: the compiler and the JVM. The compiler comes bundled with other useful programs for you to use. This bundle of programs is called the Java Development Kit (or JDK). On the other hand, the JVM also comes bundled with exciting up-to-date features called the Java Runtime Environment (or JRE). For more in-depth detail, read the section on the Java Platform. Unlike most other computer programming environments, the complete Java platform (both JDK and JRE) is free to download from Sun Microsystem's website - http://java.sun.com/javase/downloads/index.jsp
Clicking on website link above, you would be taken to a download page giving you an option to download the various components needed for Java programming. If you feel you don't have enough space for both the software to be installed on your system (which is highly unlikely) you should, in that case, opt only for the JDK as that is the only component necessary to build a complete Java program. The JDK comes with its very own JRE. With that said, once the software is downloaded and installed on the system, we can begin with the rest.
[edit] Setting up the environment
Once you have Java installed on your system, we just need to worry about writing the actual code. This is done using a text editor - Notepad or WordPad would do. But these editors can only provide you with a limited ability to write text and save files. You need to make your editor do lots of other stuff as well, like compiling the code for you, showing you how the code works and telling you off when you write wrong code. A text editor that can do all that is called an integrated development environment (in short IDE). There are a dozen IDEs to choose from and the good news is - most of them are free to download and install. Some IDEs worth mentioning are:
- Eclipse: This is a powerful IDE that supports Java and many other programming languages like C/C++, PHP and Python. It is open source and free to download, install and use. Since Eclipse is open source, it has a strong user base and you can find a lot of people online who can tell you how to work the IDE.
- NetBeans: Like Eclipse, NetBeans is also an integrated development environment that support various languages other than Java but the plus point for this IDE is that it is built by the people who made the Java language. And it is free, too!