Welcome to the World of Java Programming - Java Bootcamp: Learn the Basics of Java Programming in 2 Weeks (2014)

Java Bootcamp: Learn the Basics of Java Programming in 2 Weeks (2014)

Chapter 1. Welcome to the World of Java Programming

Java is considered a high-level programming language designed to create powerful, secure applications. It runs on various platforms or operating systems, like Windows, Mac OS X, Linux, and several versions of UNIX. Java is a programming language known for its flexibility, maintainability, and scalability.

First, you need to install Java in your computer or you can go here for online coding. As stated in the introduction of this ebook, you need to have basic computer knowledge. It also helps a lot if you are familiar with a particular programming language or Java.

A Bit of Java History

James Gosling founded Sun Microsystems. In June 1991, Gosling began the Java language project. It was initially called Oak, and then Green. In the end, it was named Java for no particular reason. Java 1.0 was released in 1995. The current Java Standard Edition is Java SE8.

On 2007, Java’s core code was released as free and open source software, apart from a tiny segment of code that Sun had no copyright.

Java has Several Advantages

Java is object-oriented, which means that everything is an object when it comes to Java. It can be extended with ease.

It is also considered platform independent, unlike most programming languages such as C and C++. When you compile Java, you don’t compile it into platform-specific machine; rather you compile it into byte code. The said byte code is disseminated over the web and a virtual machine interprets it.

Java is simple, it is easy to learn. However, it is best for you to have a deeper understanding of the concepts of Object Oriented Programming (OOP) so it will be easier for you to master Java. One of the main advantages of object-oriented programming over procedural programming is its ability to let a programmer create different modules that don’t need modifications even if he adds a new type of object. You will understand more of it when you enhance your knowledge regarding OOP while you learn Java programming.

Java has secure features; it has the ability to help you create a tamper-free, virus-free system.

The Java compiler can generate an architectural-neutral object file format. The compiled code is executable on many processors with Java runtime system. This also makes Java portable.

Java is dynamic; many programmers believe that it is actually more dynamic than C++ or C. Java can effectively adapt to any environment.

There are more advantages of Java, and you will discover them all as you learn Java programming and gain further knowledge regarding the beauties of OOP.

Things that you will Need to Start your Journey into the World of Java Programming

You need a computer powered at least by an Intel Core2Duo processor, and has a minimum of 1GB of RAM. These are actually the most basic, if not lower, specs of most computers you can buy today. If you can play videogames on your computer then it has more than enough power for Java programming.

Your Operating System (OS) should be Windows XP, Windows 7, Windows 8, or Linux. This book has provided the set up paths for the said platforms, although it is recommended to use the provided link for online coding to get your started immediately.

You need to choose Java JDK8 if you choose to install Java in your computer.

You also need to get Microsoft Notepad or other text editor.

Local Environment

If you would like to create a local environment set up for your Java programming, then you need to go to this link to download Java for free, make sure to choose the version that is compatible with your OS.

After choosing the right Java for your OS, follow the instructions to download Java properly and run the “.exe” file that will allow you to install Java in your computer. Once installed, you need to set the path for your particular platform.

The Path for Windows

Let us assume that you have successfully installed Java in your computer, it looks like this when you try to view the directory:

c:\Program Files\java\jdk

Point your cursor on ‘My Computer’ and click on it. Once you have opened it, right-click on it and choose ‘Properties’ (located at the bottom part of the choices).

Under the ‘Advanced’ tab you will see a button that says ‘Environment variables’, you need to click on it.

You need to modify the ‘Path’ variable next. It needs to contain the path to Java.exe. If your current path is set to:

C:\WINDOWS\SYSTEM32

you need to change the path to read:

C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin

The Path for Linux, UNIX, Solaris, FreeBSD

You need to set the environment variable PATH to properly point the location where the Java binaries are installed. You can refer to your shell documentation if you encounter some trouble setting the path.

If you use ‘bash’, for example, then you need to add ‘export PATH=/path/to/java: $PATH', it would appear like this:

.bashrc: export PATH=/path/to/java:$PATH

The Popular Java Editors

The programming languages in the past did not need text editors, unlike most modern programming languages, but you need to use one for Java programming. There are several sophisticated IDEs (Integrated Development Environment) that you can use for your Java programming. IDE is a software application that presents or gives comprehensive facilities for software creation or development that programmers can use. IDE typically consists of build automation tools, debugger, and text editor.

Here are some of the most popular text editors that you can use:

1. Notepad – if your computer runs on Windows, then you can use the built-in Notepad editor to write your code.

2. Netbeans - is actually a Java IDE that you can download free from this link.

3. Eclipse - is another Java IDE that is created by the eclipse open-source community. You can download it free from this link.

Once you have everything ready, we can proceed to learning the basics of Java programming that can take you closer to your goal of creating a Java program all on your own.