Jar « Build Deploy « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Build Deploy » Jar 

1. Java Tip 70: Create objects from jar files!    javaworld.com

In Java Tip 49, (coauthored with Arthur Choi) we learned how to extract Java resources from jar (Java Archive) and zip archives, and in Jack Harich's Java Tip 39, we learned how to create custom class loaders to load class files via the local filesystem or the network. In this new Java Tip, we're going to put that knowledge to work, loading classes from jar files.

2. Java Tip 127: See JAR run    javaworld.com

To execute a jar file, you can use the java command's -jar option. For example, say you have a runnable jar file called myjar.jar. Because the file is runnable, you can execute it like this: java -jar myjar.jar .

3. Java Tip 120: Execute self-extracting JARs    javaworld.com

You can convert a base zip or jar file into an executable jar file on any Java platform. Whereas the self-extracting zip can only create platform-specific executables, the self-extracting jar file can be distributed to and run on any platform supporting Java.

4. Java Tip 49: How to extract Java resources from JAR and zip archives    javaworld.com

A quick note about naming. Archiving support in Java actually started out using the popular zip archiving format (check out "Java Tip 21: Use archive files to speed up applet loading"). So, originally, in implementing Java support to manipulate the archive files, all of the classes and whatnot were placed in the java.util.zip package; these classes tend to start with "Zip." But somewhere in the move to Java 1.1, the powers that be changed the name of the archive to be more Java focused. Hence, what we now call JAR files basically are zip files.

5. Programmatically Signing JAR Files    onjava.com

It is not an accident that programmatic JAR signing isn't supported by the core Java library. JAR signing gives users the ability to verify the integrity of the classes and other resources contained within the archive. Most JAR files are signed with the private key of the archive author, which is the end of a certificate chain that begins at a well-known certificate authority. Standard private key usage dictates that the password protecting a private key be kept only by the code author; storing the password on a computer makes the password inherently insecure. Thus, in most cases, programmatically signing JAR files is a frowned upon; however, there are a few cases when it is necessary.

6. A Console Terminal for JARs    today.java.net

The new java.io.Console class has a bunch of convenience functions that make it easier to read from and write to Console objects. But the only really new feature is the readPassword() method. The readPassword()s (there are two flavors) hide what the user is typing in, a feature that has been in demand for a long time. Also new is the System.console() method. It is interesting that it institutionalizes the fact that a console may not always be available. So we may presume that System.console() will in fact return null in a JAR activated by a double-click. Jar-Stdio-Terminal could possibly be used in some of those situations.

7. (Not So) Stupid Questions 10: JAR Files    today.java.net

Editor's note: Sometimes the most interesting discussions begin when someone says, "This may be a stupid question, but ...." If the person asking the question has taken the time to think about the problem before asking, the question is often not stupid at all. The uncertainty points out an ambiguity in the specs, holes in the docs, or a search for how more experienced programmers might address a particular problem. From time to time, we will print one of the "(Not So) Stupid Questions" we receive and invite our readers to answer the question in the feedback section.

8. Python Boosts JAR File Auditor Functionality    devx.com

Python's Advantages Over Java The original Java version of the auditor walks a specified directory tree and audits it for duplicate jar files and duplicate class files within them. The problem with its algorithm is that the design relies on the existence of duplicate jar files in order to identify duplicate class files. For example, if class A were in JarFile1 and another instance of class A was in JarFile2, the Java auditor wouldn't catch the duplication because the jar file names are different.

9. Put an End to Jar File and Class Name Conflicts    devx.com

This tutorial discusses how to use this utility, or "auditor" as I refer to it, which you run from the command line. It displays results in a GUI interface (as shown in Figure 1), or saves results as an XML file (as shown in Internet Explorer in Figure 2).

10. Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)    java.sun.com

Your use of this page (http://java.sun.com/docs/books/tutorial (Last Updated 2/14/2008)) and all the material on pages under "The Java Tutorials" banner is subject to the Terms of Use. Additionally, (i) any example code contained in any of these Java Tutorials pages is also licensed under the Code Sample License, and (ii) the entire Java Tutorials content is available for download under the Java Tutorials Limited Non-Commercial License for limited, non-commercial individual and/or research and instructional use at Sun Download Center.

11. Simplify your application delivery with One-JAR    ibm.com

Overall, One-JAR is a simple yet powerful solution to the problem of packaging applications for delivery. It doesn't provide for every possible application scenario, however. For example, if your application uses an older-style JDK 1.1 classloader that doesn't delegate to its parent, then the classloader will fail to locate classes from within a nested JAR file. You could overcome this by building and deploying a "wrapping" classloader to modify the recalcitrant classloader, although this would entail using bytecode-manipulation techniques with tools such as Javassist or Byte Code Engineering Library (BCEL).

12. Accessing zips and jars using Java Part 2    developer.com

This is the second half of a two part series on accessing zip and jar files using Java. In part one, we explained how to get the table of contents of a zip file or a jar file and how to get the manifest of a jar file. In this part, we'll show you how to create, add files to, and extract files from zips and jars.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.