Technology Inside Out!

Index ¦ Archives ¦ Atom ¦ RSS

JAVA - Getting Started with Introduction

Introduction_to_java

Before learning JAVA, it is advisable that you should have a programming background. Even if you re not from programming background, I will try to make it as simple as I can.

JAVA is one of the most powerful language. The various software which are powered by this programming language are Rhino( open source implementation of JavaScript ), Sun SOPT( wireless, battery powered experimental platform ), ThinkFree( java version of Microsoft Office ), NASA World Wide( java application like Google earth ), UltraMixer( DJ mixing software ) and above all Android applications as well.

It is a programming language, which is based on the concepts of C++ ( inheritance,OOPs etc. ). It works on the motto

"Write Once, Run Anywhere".

How does JAVA works?

  1. Create a source file in this language and save it with .java extension.
  2. Path of the source file is given to the JAVA compiler( javac ), the work of this compiler is to check for the errors, exception handling etc and then converting the .java file into a Byte-code, this byte-code is stored in a file with the extension .class . Byte-code is platform independent.
  3. Now, we just require a JVM( Java Virtual Machine ), which will take byte code( .class file ) and then execute it.

How JAVA changed the Internet?

  • Applets: A JAVA applet is a small program which is embedded in a web-page. Whenever a web-page ( embedded with applet ) is loaded at that point, Byte-Code is transferred and it is executed by the JVM( Java Virtual Machine ).
  • Security: Whenever the JAVA code/software is distributed, it is always downloaded in the form of byte code, rather than the code itself. It is one of the major differences from C++, in which the source code is always distributed and anyone can make changes, implement it in his own way etc.
  • Portability: It works on the principle of "Write Once, Run Anywhere". JAVA( language ) is platform independent, whereas the JVM( executes byte-code ) is platform dependent.

Features of JAVA:

  1. Simple
  2. Purely object oriented
  3. Secure
  4. Portable
  5. Robust
  6. Better look and feel than C/C++

Various Terms :

  • JDK: Java Development Kit( JDK ) is consists of Java compiler, JVM and JRE.
  • JRE: Java Run-time Environment( JRE ) consists of the JVM, along with libraries and supporting files(appletviewer etc.) as well. JRE is a part of JDK.
  • JVM: Java Virtual Machine( JVM ) is a virtual machine which executes byte-code. It is provided along with JRE.
  • Environment variables: Environment variables is a dynamic "object" on a computer, which stores a particular value, and this value is referred frequently by certain programs on the system.

Requirements:

  1. JDK 7 Download it From Here
  2. Notepad/Notepad++(or any text editor)
  3. Do NOT use IDE, as it may protect you from some of the details which really matter.
  4. After installing JDK, we have to set an Environment Variable named "path"

Setting the Environment variable ( in Windows 7 and 8)

  • Right Click on My Computer and select Properties.
  • Select Advanced System Settings, then go to Advanced Tab.
  • Click on Environment Variables, then click on New.
  • Variable name: path
  • Variable value: give the path directory till bin folder, in most cases the value will be C:Program FilesJavajdk1.7.0_45bin

NOTE: Those who are using Linux or Windows XP, use Google for setting up the environment variables.

© The Geeky Way. Built using Pelican. Theme by Giulio Fidente on github.

Disclaimer Privacy policy