Java Application Development on Linux
ISBN : 013143697X
Cover Design - Java Application Development on Linux
For your free electronic copy of this book please verify the numbers below.
(We need to do this to make sure you're a person and not a malicious script)
Sample Chapter From Java Application Development on Linux
Copyright © Carl Albing, Michael Schwarz
Preface - JAVA AND LINUX
Why another book on Java? Why a book on Java and Linux? Isn’t Java a platform-independent system? Aren’t there enough books on Java? Can’t I learn everything I need to know from the Web?
No doubt, there are a host of Java books on the market. We didn’t wake up one morning and say, “You know what the world really needs? Another book about Java!” No. What we realized was that there are a couple of “holes” in the Java book market.
First, Linux as a development platform and deployment platform for Java applications has been largely ignored. This is despite the fact that the *nix platform (meaning all UNIX and UNIX-like systems, Linux included) has long been recognized as one of the most programmer-friendly platforms in existence.
Those few resources for Java on Linux that exist emphasize tools to the exclusion of the Java language and APIs.
Second, books on the Java language and APIs have focused on pedagogical examples that serve to illustrate the details of the language and its libraries, but very few of these examples are in themselves practically useful, and they tend to deal only with the issues of writing programs, and not at all with deploying and maintaining them. Anyone who has worked on a major software project, especially a software project that is developed and deployed in a business for a business, knows that designing and coding are only about half of the work involved. Yes, writing Java code is only slightly affected by the development and the deployment platform, but the process of releasing and maintaining such applications is significantly different between platforms.
To address these missing pieces, we decided to cover development and deployment of a Java application that has command-line, GUI, servlet, and enterprise components on a Linux platform. We’re writing the guide book we wish we had had when we started writing and deploying Java applications on Linux. We’re going to show you a simplistic enterprise application, “from cradle to grave,” but along the way cover issues of design process, production environment, setup, administration, and maintenance that few books bother to cover.1
If you are considering buying this book and you are wondering if there is any information in here that you can’t get for free on the Web, then, no. There is not. In fact, there is little information in any Java or Linux book that is not available for free on the Internet. In fact, in each of our chapters we will tell you where on the Web to find virtually all of the information we present, and then some. And yet books continue to sell, and we have the chutzpah to ask you to buy the book. The reason is that Web information is scattered, unorganized, and of highly variable quality. We will be trying to bring all the relevant information together in this book, in a clearly organized manner (and, we would like to believe, at an acceptably high level of quality). We think that has value.
Also, this book is part of the Bruce Perens’ Open Source Series. This book is part of the Web literature. And you may freely read it and use it on the Web. We hope this book will be one of those you use on the Web and buy on paper. We don’t know about you, but we like to use Web books for reference, but for reading, we like books. We own at least three books that are available for free on the Web: Thinking in C++, Thinking in Java, and O’Reilly’s Docbook: The Definitive Guide. We hope that open publishing will be the new model.
FREE SOFTWARE AND JAVA
GNU/Linux2 is Free Software. It is Open Source. I don’t even want to start the debate on what each term means and which one is “right.” One of the two authors of this book is a Free Software advocate, and the other is of a purely laissez-faire attitude towards the question (we won’t tell you which, although we invite you to guess). But even with a deliberate decision to cease-fire, the question remains: Is Java Open Source or Free Software?
The answer is mixed. Neither Sun’s nor IBM’s Java implementations are Open Source or Free Software. You may download and use them for free, but you do not have the source code to them, nor do you have the right to make modifications to them.3 This book will cover the GNU Compiler for Java, which compiles Java source code to native machine code. The GNU Compiler for Java (gcj) is both Open Source and Free Software. It is, however, supporting differing levels of the Java APIs (some packages are current, some are back at 1.1.x levels) and does not fully support the AWT or Swing GUIs.
However, none of this means that you cannot write your own Java programs and release them under a Free Software or Open Source license. So you can certainly develop Free Software in Java. Staunch Free Software partisans (such as Richard Stallman and the Free Software Foundation) would question the wisdom of doing so. Their argument would be that a Free Software product that depends on non-Free tools isn’t really Free Software, since to compile, use, or modify it, you need to make use of a proprietary tool.
There is more than one effort to produce a Free Software Java runtime implementation. None of them is “ready for prime time.” It would, in our opinion, be a very good thing for Sun to release their SDK and Java Virtual Machine as Free Software. But so far, they have steadily resisted calls to do so. The fact, however, that two distinct vendors (Sun and IBM) produce effectively interchangeable development and runtime environments reduces some of the risk that you face when you select a platform available only from a single vendor who does not provide source code.
So, to put the case firmly: Java is free for use, but it is certainly not Free Software as defined in The GNU Manifesto 4 or the GNU General Public License. 5 This is a political and philosophical issue of interest only to those aforementioned Free Software partisans. For the rest of us, this has no bearing on Java’s technical or business merits. As for us, obviously we like the language or we wouldn’t be writing about it.