Archive

Archive for August, 2009

Java Primer

 

 

 

Java Logo

 

 

Java Origin:

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995. The language derives much of its syntax from C and C++ but has a simpler object model. Java applications are typically compiled to bytecode (class files) that can run on any Java virtual machine (JVM) regardless of computer architecture or operating system. As of May 2007, in compliance with the specifications of the Java Community Process, Sun made available most of their Java technologies as free software under the GNU General Public License (GNU GPL or simply GPL is a widely used free software license).

It was originally designed for use on digital mobile devices, such as cell phones. However, when Java 1.0 was released to the public in 1996, its main focus had shifted to use on the Internet. It provided more interactivity with users by giving developers a way to produce animated webpages . Over the years it has evolved as a successful language for use both on and off the Internet. A decade later, it’s still an extremely popular language with over 6.5million developers worldwide.

There were five primary goals in the creation of the Java language:

  • It should be “simple, object oriented, and familiar”.
  • It should be “robust and secure”.
  • It should be “architecture neutral and portable”.
  • It should execute with “high performance”.
  • It should be “interpreted, threaded, and dynamic”.

 

Java Introduction:

 “Java” generally refers to a combination of three things: the Java programming language (a high-level, object-oriented programming language); the Java Virtual Machine (a high-performance virtual machine that executes bytecodes on a specific computing platform, typically abbreviated JVM); and the Java platform, a JVM running compiled Java bytecodes, usually calling on a set of standard libraries such as those provided by Java Standard Edition (SE) or Enterprise Edition (EE).

For every dusty definition that speaks of applets and Just-In-Time compilers, there are new directions and new realities that have settled in, understood by many, yet not always completely documented. Java used to mean:

  • Applets
  • Bytecode interpretation
  • Slow performance
  • A “cargo cult” awaiting drops from Sun

Today, it means:

  • Web applications, web services, SOAs, etc.
  • Hotspot dynamic compilation
  • High-performance
  • An open source community, increasingly independent of Sun

The old slogan “Write Once, Run Anywhere” still holds true–but what’s being written and where and how it’s being run are changing.

  

Implementations: Read more…

Why Java?

 

 

Java owned by Sun Microsystems, Inc. is just another object oriented language which is easy to learn and easy to use. C and C++ have thier share of uses and users deservingly and Java takes it all to another level. It is not difficult for any C/C++ developer, or any object oriented/non-objected oriented developer to get hands on with Java. Various tutorials, crash courses are available all over the internet space for starting up with Java or migrating to Java from any other technology.

Java has lot to offer and that can be inferred by its wide use. It might be one of the reasons for many in trying to know “what is this Java all about anyway?”. It can be used from simple applications to enterprise business applications. Apart from the featurs that we discuss below, other reason is also that Java being free and an open-source software, many third party organizations have used / based Java to develop robust frameworks and high-end solutions for today’s real-time applications. From Sun’s own enterprise solution J2EE to various other server-side solutions, Java has been in the heart of many business applications today. Let’s try to explore why Java is what it is today.

Traditionally, software programs were being written in source code and then compiled into machine code that talks directly to the operating system on a computer. This means that traditional programs depend on, and are bound to, a particular platform. Porting from one platform, or operating system, to other, is traditionally time-consuming and prone to errors. The Java platform is a virtual platform that mitigates this dependency by providing a model in which software is written and compiled, and can then be transmitted over a network and run anywhere by a fully compliant virtual machine. This model provides the additional benefit of heightened security, both because programs can be verified by the client’s virtual machine after they have been transmitted over a network, and because the client’s virtual machine can run programs in a secure “sandbox” that prevents certain destructive behaviors.

Software programmers have embraced the Java platform because it reduces the cost and time required to write and support software code. They are no longer required to rewrite software to function on different computers with different operating systems. Companies and organizations deploying applications, favor Java technology because it minimizes the cost of purchasing or modifying different versions of software applications for the various types of computers and servers within their networks.

 

Sun Quotes:

To date, the Java platform has attracted more than 6.5 million software developers. It’s used in every major industry segment and has a presence in a wide range of devices, computers, and networks.

 

Few of the reasons for Java’s popularity: Read more…

Ant Installation & Configuration

  

  

At the time of this post, the latest stable version available form Apache is 1.7. Older releases of Ant can be found here. Old releases are only provided as zip archives that can be extracted by jar xf archive.zip. Its highly recommend to not use old releases but upgrade to Ant’s latest release.

Ant 1.5.4 is the last release that supports JDK 1.1, Ant 1.6.0 onwards requires JDK 1.2 or later. There will be no other compatibility issues with Java versions otherwise. Current version of Ant i.e., 1.7, requires JDK version 1.2 or later, 1.5 or later is strongly recommended. Latest the version of Java is, the more Ant tasks you get. If a JDK is not present, and only JRE is present, then many tasks will not work.

  

Follow the steps below to download, install and configure Ant : Read more…

Eclipse IDE Installation & Configuration

August 24, 2009 2 comments

 

 

At the time of this post, the latest Eclipse package version available to download is Eclipse 3.5.0. Eclipse releases are named after the moons of Jupiter, and each denotes a successive release. For Ex, Galileo is 3.5 which is the latest version, previous versions are Eclipse Ganymede which is Eclipse Version 3.4.0, and Eclipse Europa which is Eclipse Version 3.3.0. Eclipse is free for downloading. All you have to do is navigate to http://www.eclipse.org/downloads , chose and download the Eclipse package suitable for your requirements from one of the download mirrors available, such as:

  • Eclipse Classic 3.5.0 (The classic Eclipse download includes the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation.)
  • Eclipse IDE for Java Developers (The essential tools for any Java developer, including a Java IDE, a CVS client, XML Editor and Mylyn)
  • Eclipse IDE for Java EE Developers (If you want to develop web applications, you should download Eclipse IDE for Java EE DevelopersTools for Java developers creating Java EE and Web applications, including a Java IDE, tools for Java EE, JPA, JSF, Mylyn and others.)
  • Eclipse packages for PHP, C/C++ Developers, etc.

 

 

Since Eclipse is a Java program, you will need to have Java installed on your computer to run Eclipse [Refer to Java Installation & Configuration post for details]. Eclipse can run on a number of Java Virtual Machines. Eclipse officially recommends Java version 5 (also known as 1.5), although many Eclipse users use the newer version 6 (1.6).

Sun’s Java is available in two main distributions: the Java Runtime Engine (JRE) and the Java Development Kit (JDK). If you are using Eclipse for Java development, the JDK offers several advantages, including the availability of source code for the Java classes. If you are using Eclipse for something other than Java development, the JRE is all you need. Once you have a Java VM installed, you’re ready to work with Eclipse.

 

Download Instructions:  Read more…

Tomcat Installation & Configuration

 

 

At the time of this post, the latest stable version available form Apache Tomcat is 6.0.x. Older releases of Tomcat can be found on download section of http://tomcat.apache.org/. Apache Tomcat version 6.0 implements the Servlet 2.5 and JavaServer Pages 2.1 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services.

 

Different versions of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The following table shows the dependancies:

 

Servlet/JSP Spec Apache Tomcat version
2.5/2.1 6.0.x
2.4/2.0 5.5.x
2.3/1.2 4.1.x
2.2/1.1 3.3.x (archived)

 

  

Before downloading Tomcat, you might want to know about the different releases available from Apache:

  • Alpha releases may contain large amounts of untested/missing functionality required by the specification and/or significant bugs and are not expected to run stably for any length of time.
  • Beta releases may contain some untested functionality and/or a number of relatively minor bugs. Beta releases are not expected to run stably.
  • Stable releases may contain a small number of relatively minor bugs. Stable releases are intended for production use and are expected to run stably for extended periods of time.

 

Pre-requisites:

Tomcat requires Java to be installed on your computer to run. Make sure you have a recent Java version installed and JAVA_HOME variable to be set. Note: Refer to Java Installation and configuration post for details. After setting the JAVA_HOME environment variable, you can install tomcat.

 

Download Instructions: Read more…

JDK 7 With Danny Coward

 

 

Just recently we had a post about Java versions, and timely SDN has given us a precious insight into JDK 1.7. As Ed Ort candidly speaks to Danny Coward about the venture, Danny reveals few of the new functionalities that will be incorporated in JDK 1.7.

 

Vodpod videos no longer available.

 

Guest Host/Blogger: Ed Ort, Senior Staff Information Engineer, Sun Microsystems
Guest: Danny Coward, Chief Architect for Client Software at Sun Microsystems
August 20, 2009

 

SDN Quotes:

Learn about some of the new and cool features in the next release of the Java Development Kit, JDK 7. In this Deep Dive, Danny Coward, Chief Architect for Client Software at Sun Microsystems, highlighted some of the significant new features in JDK 7. Some of these features focus on modularizing the JDK, supporting non-Java languages at the VM level, and making developers more productive through various small changes to the Java languages. Danny backed up this discussion with some code examples and demonstrations.

 

Few prominent features of JDK 1.7: Read more…

MySQL Tips for Java Developers With Mark Matthews.

  

MySQL Server is available as free software under the GNU General Public License (GPL). Its most often the first choice for small scale projects. Even established free software projects which require a full-featured database management system use MySql, such as WordPress, hence establishing the reliability of the server.

Lot of us here have our share of experiences with Java & MySql. Database transactions are always the most expensive processes (in terms of resource consumption) in any industry application. Its beneficial to dish out tips and tricks about database connectivity for any java developer. The following interview throws some more light on this significant subject. Read more…