Derek Bridge

Past Teaching

Software Development

How to download JAR files

This web site contains a number of links to Java programs that were covered in lectures. These links are typically labelled with the suffix jar. On this web page, I explain how to take copies of these files.

  1. Download: Do not use your left mouse button to follow the hyperlink! If you do, the page that appears will contain quantities of apparent gobbledegook. Cutting-and-pasting this gobbledegook into another file is a completely pointless thing to do. This will not work!

    Instead…

    Click on the hyperlink using your mouse's right button. A menu should appear and one of the options on the menu will be Save. Use this to save the file in some suitable part of your home directory.

  2. Unpack: The file you have saved may contain several other files. They were concatenated together and compressed using a Java tool called jar. To extract the files, we again use jar.

    Suppose the file is called lect4.jar. To extract its contents, type the following:

    jar xf lect4.jar
    

    If you now list your current directory, you should find new files or directories. In this example, you'll find a new directory called lect4code. The Java program is in this subdirectory.

    There are many more sophisticated things you can do with jar. If you want to know about them, consult our local copy of the Java tools reference page.

  3. Tidy up: You can save disk space and keep your directories tidy by deleting two things: the jar file (e.g. agentDemonstrator.jar) and another directory that gets created called META-INF.