From LQWiki
Java technology is both a programming language and a platform. One of the major reasons for its popularity is that it is "cross-platform" - a correctly-written piece of Java software will run on any computer that has a Java Virtual Machine installed. Specialised Virtual Machines even exist for mobile phones and PDAs.
Contents |
The Java Programming Language
The Java programming language is a high-level, multi-threaded, object oriented, usually interpreted language.
The Java Platform
The typical Java platform has two components; the Java Virtual Machine (Java VM or JVM) which runs Java programs, and the Java Application Programming Interface (Java API) describing the classes and operations available to Java programmers. The JVM isn't needed if you compile your java code with GCJ (though, currently, GCJ doesn't provide all the packages to completely cover all the Java API's).
Get Java
You should get java by means of your distribution, as described in installing software. For example, with SUSE Linux 11.1:
yast -i java-1_6_0-sun-1.6.0.u14-0.2.1
However, if you need a special version you will have to download it, e.g. from java.sun.com.
The Java Plugin
To display a java applet, web browsers need a java plugin. Installing it goes straightforward if you install by means of your distribution and is a bit tedious if you do not, e.g. because you need a specific version. An example easy install is given below for SUSE Linux. If you need a special version, you will have to go the generic (non-distribution-specific) way.
SUSE Linux
Start your program management
yast2 sw_single
Search for java and select the java plugin. Click on "install".
generic
Here is an example how to install a java plugin, it has been done on 2009-08-19 using SUSE Linux Enterprise Server Service Pack 2 X64. We are using firefox as browser. The process for other distributions may work similar.
- visit java.sun.com, download jre 6 update 16, the rpm version for "Linux". Note that you download a 32-bit plugin for 32-bit software running on a 64-bit platform.
- install the software
# chmod 777 /root/jre-6u16-linux-i586-rpm.bin # /root/jre-6u16-linux-i586-rpm.bin
- find out your java path
# rpm -qa --last | tac [...] jre-1.6.0_16-fcs Wed 19 Aug 2009 08:40:24 AM EDT
- find out where the java plugin for the browser is stored
# rpm -ql jre-1.6.0_16-fcs | grep libjavaplugin_oji /usr/java/jre1.6.0_16/plugin/i386/ns7-gcc29/libjavaplugin_oji.so /usr/java/jre1.6.0_16/plugin/i386/ns7/libjavaplugin_oji.so
You see there are two java plugins, one for distributions compiled with GCC 2.9 and the other for newer distributions.
- go to your firefox path
# which firefox /usr/bin/firefox # cd /usr # cd lib/firefox/
- go to your plugin directory
# cd plugins/
- link the plugin file into the plugin directory
# ln -s /usr/java/jre1.6.0_16/plugin/i386/ns7/libjavaplugin_oji.so .
- stop all firefox
# killall firefox-bin
- start firefox
# firefox
- surf to about:plugins. You must find a java plugin in the list there.
Language Features
Java's main advantages are that it is extremely portable and that it is easily incorporated into web pages in the form of applets. Other features include automatic garbage collection and optional security - one does not need to give a Java program full access to one's computer.
If you are making changes to an existing Java program, the class file structure allows source compatibility and binary compatibility to be essentially the same thing. Significant additions can be made to large programs with recompilation required for only the altered parts. In general, Java allows for easier program alteration than native code compiled languages.
See also
- Java tips
- Compiled languages section
- Unified Modeling Language
- Java-GNOME -- Java bindings for GNOME.
- Jython
- Java Installation in Debian
- Java-Debian -- installation tips
External links
- Official Java website (java.sun.com)
- Object orientation in Java (java.sun.com)
- Visual Paradigm for UML(Community Edition) (www.visual-paradigm.com)
- Free UML CASE Tool
- SDE for Eclipse(Community Edition) (www.visual-paradigm.com)
- Free UML plugin for Eclipse
- Java Game Development (javagamedevelopment.net)
- Daily News & Tutorials on Java Game Development
Further Reading
- Java How to Program, by Dietel et al (my source only supports the first two versions.)

This page is available under a