Beginner's Guide to JDK
Although several ongoing projects have the goal of porting Sun's Java Development Kit (JDK) to Linux, for the purpose of this article I will look at the largest and most stable effort. It is hosted by the Blackdown Organization, with much of the effort coming from Randall Chapman (for JDK 1.0) and Steve Byrne (for JDK 1.1). At the time of this writing (August 1998), JDK 1.1.6 version 3 was in beta testing. This version will be publicly released by the time this magazine is printed. See the Blackdown's web page at http://www.blackdown.org/java-linux.html for up-to-date information on the JDK port for Linux.
Note that I use the Caldera Open Linux 1.2 Standard distribution of Linux, so I will discuss the JDK installation with respect to that distribution. The JDK 1.1.6 port to Linux is quite stable on Caldera Open Linux 1.1 and 1.2 out-of-the-box installations. It will also work with many other distributions of Linux.
The Blackdown Java Linux porting effort still needs volunteers. Please feel free to contact them. In fact, I received an e-mail message from Steve Byrne stating that the source code is not hard to understand and many areas besides debugging need volunteers. He also said many areas of specialization exist in the source code, so if you are good at one thing but not another, please don't let that stop you from volunteering.
I will review the high points of three different JDK files, drawing on personal experience. The main source of information is the Java Linux FAQ at the Blackdown site. The first file is http://www.blackdown.org/java-linux/docs/faq/FAQ-java-linux.html. The two other files are the README that comes with Sun's JDK and the README.linux that comes with the Linux port of the JDK. These two files are found in the jdk1.1.6 directory after installing the JDK. There is also a link to README.linux from the Java-Linux FAQ.
Two types of Java programs exist: applications and applets. Applets are simply small Java programs that run within the context of a web browser. Applications are stand-alone programs.
Both applications and applets start as Java source code files. When a Java program is compiled, the source code is turned into Java byte code. In general, a byte-code file is generated for each “class” declared in your source-code file. These byte-code files have the extension “.class”.
The byte code is then interpreted by the Java Virtual Machine (JVM). Unless you have a machine that implements Java byte code in hardware, the JVM is a program run by the operating system you are using. This is the case under Linux.
As I stated before, the difference between applications and applets is revealed by the way each is started. An application is started from the command line. It is a stand-alone program. In contrast, an applet is started by a web browser.
When an application is written, a method called main is defined. Execution of the application starts in main. To start an application at the command line, type java SomeApplication. Please note that you do not type in the .class extension.
An applet has a method called init. In addition to the applet byte code, an HTML file exists which contains an <APPLET ...> </APPLET> tag pair defining the location of the byte code and other useful information. When the applet is started from within a web browser, init is called to start the applet. An applet can be started from the command line with a program called appletviewer. This program, distributed with the JDK, takes the name of an HTML file, finds all applet tags and runs those applets.
Both main and init can be implemented in a single Java program. The resulting program can therefore be started by either java SomeApplication or with a web browser.
As I mentioned above, the Blackdown Organization is the repository for the largest Java Linux effort. This site contains distribution locations, e-mail lists and known problems with the current JDK for Linux. Currently, the latest release of the Java Development Kit for Linux is JDK 1.1.6 version 3.
JDK comes in two flavors: one for libc and one for glibc. For an explanation of the differences, see the Java-Linux FAQ. According to the README.linux file that comes with the JDK, a good way to determine which version you need is by looking at the libraries installed on your system. This can be done with the following command:
ls -l /lib/libc.so.*
If the files are libc5, you should download the libc version. If they are libc6, then you should download the glibc version.
To download the JDK distribution, point your web browser to http://www.blackdown.org/java-linux/mirrors.cgi. This page lists sites that distribute the JDK. You can obtain the Linux JDK port only from a mirror of Blackdown.
Take a look at the mirrors, and choose a download site near you. Since Caldera uses libc5, I followed the links to JDK-1.1.6/i386/libc/v3/. Download the file jdk1.1.6-v3-libc.tar.gz. You can also download other files from this directory.
Choose a directory to unpack the distribution using the tar command. I chose /usr/local/. If you choose a different directory, use that directory in place of /usr/local/ wherever it appears in the rest of this article. Once you've picked a directory, go to it using cd, then type:
tar xzf jdk.1.1.6-v3-libc.tar.gz
The installation of JDK is complete. You should now visit JavaSoft to download documentation. Please see http://www.javasoft.com/docs/index.html for download and installation instructions.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Chris Birchall's Re-Engineering Legacy Software (Manning Publications)
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- ServersCheck's Thermal Imaging Camera Sensor
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Privacy and the New Math
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide