Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

libraries to use. To compile, you need the package ghc, which is the Glorious
Glasgow Haskell Compilation system (GHC), a compiler for Haskell.


Java


Java was created by Sun Microsystems, now owned by Oracle, as a write-
once, run-anywhere language. Java programs are compiled to a bytecode that
will run on any JVM. A JVM must exist on a hardware platform for Java code
to run, but no recompilation of the program itself is needed for it to run on
different hardware platforms. Java is object oriented, and writing program
instructions for a virtual machine is generally easier than doing so for a real
machine. Java syntax is similar to that of C and C++ but is a bit simpler and
has fewer low-level abilities. It is currently one of the most popular
programming languages. Originally, Java technology was proprietary and
licensed for use by Sun. In May 2007, several years before being bought by
Oracle, Sun finished relicensing and releasing most Java technology under the
GNU GPL. (There were parts Sun could not relicense because it did not own
the copyright to the code.)


Java uses automatic garbage collection to remove objects from memory when
they are no longer in use. This frees programmers from thinking about
memory management. It includes a graphical user interface library called
Swing.


Most Java development occurs in an IDE, several of which are available from
the Ubuntu repositories. The most popular IDEs are Eclipse
(www.eclipse.org) and NetBeans (www.netbeans.org). Each of these includes
plug-ins that help a programmer include and use libraries, compile to
bytecode, and do many other tasks quickly and efficiently.


To program in Java on Ubuntu, you write programs in your favorite text
editor or IDE. To compile, you need the package default-jdk, which
installs the Java Development Kit appropriate for the hardware being used.


JavaScript


JavaScript is an object-oriented, functional programming language designed
primarily for scripting. It supports closures and dynamic and weak typing, and
it has a syntax that is influenced by C and Java, even though it is unrelated to
either (except for the circumstantial name similarity with Java). JavaScript
was designed to be used by the Netscape web browser as a way to run short
programs on web clients. The name is a result of a mid-1990s marketing

Free download pdf