Head First Java Chapter 17

Release Your Code

Tharaka Dissanayake
2 min readJul 19, 2022

Deployment options.

1 Local deployment:

Stand-alone applications deploy to jar files. JAR is the “Java ARchive”

2 Combination of local and remote:

There are some applications that have two parts. One goes to the servers but the other part works on local machines.

3 Remote:

The whole application is deployed to the server. Therefore, users might use a browser to access it.

With executable JAR files, users don’t need to pull the class files out before running the program. There are class files in the app while running the app. To make a JAR executable, the manifest must tell the JVM which class has the main() method.

The JVM load the class from a JAR, next JVM run the main() method. While running the classes JVM is finding classes that are in the JRE file.

Java packages.

There is two kinds of packages. They are built-in packages and user-defined packages. Built-in packages come with JDK. Users can define their own packages. They are called user-defined packages.

Putting class in a package.

1. Choose a package name

2. Put a package statement in your class

3. Set up a matching directory structure

Making and deploying Java Web apps

1 Make an executable JAR for your application.

2 Write a .jnlp file.

3 Place your JAR and .jnlp files on your Web server.

4 Add a new mime type to your Web server.

5 Create a Web page with a link to your .jnlp file

--

--