Tag: Java

Oracle release Java 7 Standard Edition in 2011 July 28! This is a big news for programmers.

“We are excited to announce Java 7 is released!

With years of hard work from our dedicated engineers, the largest team ever to work on the Java language and platform, as well as valuable input from the Java community, we are moving Java forward with this release.

This release contains new language features (JSR 334), support for dynamic languages (JSR 292), a new multicore-ready API (JSR 166), new I/O APIs (JSR 203), and many other new features.”

This time we will try to install a Java IDE tool. For a Java beginner who never used Java development tools, to install a Java development environment is not that easy which you think.

But before we write any code, we need a tool to write the code, Simply, you can use anyone text editor to write a Java program, for example, you can use Notepad in Windows to write Java.

However, there are lots of professional IDE software which is free to use. The most popular IDE tool is Eclipse: Eclipse is an open source community, whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle.

(Why named Eclipse? An eclipse is in which the Moon passes through the shadow cast by Earth ? We don’t know now, maybe there was some reason, but we don’t want to spend more time to research where the name came from currently.)

You can download Eclipse IDE from their download page, However, if you are a Java beginner, you might be confused by their downloading list. see below screen shot from their site:

You can see there are at least 3 options you can choose for Java: Eclipse IDE for Java Developers; Eclipse IDE for Java EE Developers and Eclipse Classic. So what the difference are between them?

Normally, for a Java beginner, you better choose Eclipse IDE for Java Developers or Eclipse Classic.

OK, after you downloaded a package, please unzip it, move the package to C:\eclipse folder is recommended by lots of developers.

By the way for our case, we downloaded the Eclipse IDE for Java Developers Windows 64 bits package.

Installation steps:

double click eclipse.exe file, we start to the installation:

Strange we see Eclipse is still a “Unknown Publisher”. But this is not important.

Just click the Run button, maybe you will see the following error message:

A Java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: C:\eclipse\jre\bin\javaw.exe javaw.exe in your curent PATH

We really can not find C:\eclipse\jre folder. So let us go back to Eclipse’s download page to try find more information, At once we noticed there is a tips information on the right side of their page:

The Eclipse IDE requires that a Java Runtime Environment (JRE) be installed on your machine to run. Java SE 5 or greater is recommended.

There are many different implementations of the Java Platform running atop a variety of operating systems. We focus Eclipse IDE testing on a handful of popular combinations of operating system and Java Platform; these are our reference platforms. Eclipse undoubtedly runs fine in many operating environments beyond the reference platforms we test. However, since we do not systematically test them we cannot vouch for them.

The Eclipse IDE is tested and validated on the following reference platforms:

We are using Windows 7 64-bit Operating System, so we choose the first line shown on above: the JRE from Sun’s Java 5 Update 22 or from IBM’s Java SR11.

Let us go to find Sun’s JRE now. The thing you have to know is that Oracle Corporation had acquired Sun Microsystems in 2009–2010, so we find the download information on Oracle’s website:

When we click “Java Runtime Environment (JRE)”, we will be navigated to Java.com page

Note: If you click the “Free Java Download” button shown in above image , you will get a 32-bit JRE what ever your Windows 7 is 64-bit or 32-bit. But, since we are using Eclipse IDE for 64-bit Operating System, We should download a 64-bit JRE:

DO NOT click “Free Java Download” button, but look at left side on the same screen, click “All Java Downloads” link:

( Of course if you are using 32-bit OS, just click the “Free Java Download” button to continue. )

Now we will see a download page for All Java Downloads:

For our case, we downloaded “Windows 7, XP Offline (64-bit)”.

Let us stop here for this article. We will continue to discuss the left steps in our next article. Welcome back soon!

James Gosling, Mike Sheridan and Patrick Naughton started to create the Java language project in June 1991.

Why created Java language project ?

Java was originally designed for interactive television, but seems it is “Over Qualified”, it is too advance for television industry at the time. Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.

Why named Java ?

Java was not called Java originally, it was Oak since there was an Oak tree was outside of James Gosling’ office. Later Oak changed to Green, finally named to Java from a list of random words. So we know the name Java was just from a choose randomly.

When the first Java version released ?

Sun Microsystems released the first public implementation as Java 1.0 in 1995. James Gosling was working for them at that time.

Like C# (Actually C# learn from Java, but Java originally learn lots of stuff from C++), Java does not support C/C++ style pointer arithmetic.

Default file extension name?

A suffix .java

“main” is NOT a keyword in Java.

The method name "main" is not a keyword in the Java language (Actually in C#, “main” is not a keyword either, but normally in C# we use Main (capital) for a method name). Java classes that run in managed environments such as applets and Enterprise JavaBean do not use or need a main() method. A java program may contain multiple classes that have main methods, which means that the VM needs to be explicitly told which class to launch from.

What is JRE?

JRE is Java Runtime Environment. End-users use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets.

What is JDK?

JDK is Java Development Kit. Sun distributes a superset of the JRE called JDK, which includes development tools such as the Java compiler, Javadoc, Jar, and debugger.