HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 41 (of 101)
Chapter 11 Software Development
October 29, 2013
Not listed here, but of course needed by any program that uses shared libraries, is dld.sl/.so.
The dynamic loader is part of the linker filesets.
For each HP-UX shared library there normally exist an archive version too (with the extension
.a). These libraries do not belong to runtime environments because they only can be linked when
a program is built. Nevertheless they are shipped with the runtime patches.
Runtime environment upgrades always come as patches.
Java
Conventional programming languages provide source code compatibility. To make programs
written in those languages work on different platforms they must be compiled on each platform.
Java is implemented in a way to provide platform independency at runtime level. This means a
java program can be executed on any platform without recompiling it. This "compile once, run
anywhere" concept is implemented by using the java virtual machine (JVM). Instead of
providing different versions of applications for each platform, java applications are only required
in one version, but each platform needs its own JVM that runs the java application.
Compiling
When java code is compiled, it is not translated into machine code. Instead, the so called
bytecode is generated which is optimized to be read and interpreted by the JVM. The java
compiler command javac is used make translate java source code into bytecode:
javac HelloWorld.java
There are several conventions regarding the structure of java source code. Usually each source
file contains the source code of only one class
1)
which has the same name as the source file. If
HelloWorld.java is our source file, it contains a class named HelloWorld, and the above
command will generate the bytecode and store it in the file HelloWorld.class. The java
compiler has some built in intelligence similar to make(1). If it finds references to other classes,
it checks if the appropriate class files exist and are up to date, and if not, it compiles them as
well.
There is no linker involved when building a java program. A java application is represented only
by a collection of class files which are often stored in java archives (jar files). To create and
handle java archives, java provides the jar command whose usage is very similar to tar(1).
Note that jar archives are incompatible to tar archives.
1)
In simple words a class is a container for functions (methods) and variables (members) that are related to each
other. For details get a good book on object oriented programming.