I. Preface
In commercial development, development classes are often packaged into jar packages for release. many third-party jar packages provide function sets, so these function packages are often used. the following scenarios are frequently encountered by many Java developers: in the Development and debugging phase, the self-compiled class works normally by setting the third-party
(1) operate in eclipse
The above version of eclipse is:
(2) The following describes the relevant principles and the operation details for manually completing this goal:
We all know that a Java application project can be packaged into a jar. Of course, you must specify a main class with the main function as the program entry for your jar package.
The specific method is to modify the manifest. MF file under
C # Call the java class and jar package methods
1. Package the compiled Class file in java; Package the command JAR
For example, you can package all the class folders in a directory;
Command Used: jar cvf test. jar-C com /.
Here, test. jar is the
Android Make jar package:To create a new Android project, then right click, click Export, select the export type of the jar file under Java, do not select the Androidmanifest.xml and res folder in Java file specification. Otherwise, the error generating final archive:found duplicate file for Apk:androidmanifes will appear when the jar package is called.If you cal
Java programming every day with a lot of jar files, project development in the continuous guidance package, in the busy day of work, put down those complex business implementation, not only want to ask these jar package how to build, the jar package has what unique place and so on.Originally these commonly seen jar pac
Reprinted from: http://www.cnblogs.com/lanxuezaipiao/p/3291641.htmlScenario One: The export feature that comes with eclipseStep 1: Prepare the master manifest file "MANIFEST." MF ",Because it is a Java project that refers to a third-party jar package, a custom configuration file, MANIFEST.MF, is required to create the file MANIFEST.MF under the project, which reads as follows:Manifest-version:1.0class-path:lib/commons-codec.jar Lib/commons-httpclient-
Actual problem encountered: a server and Client communication program (dependent on a third-party jar pack) Console execution server or client total error java.lang.NoClassDefFoundError, and the class is not defined by itself, tangled up found is a packaging error, did not find a third-party jar package, the solution is as follows:
Scenario 0: With the eclipse with the export function, exported runnabl
1. When the project does not reference the external jar package (j2se)
Select project ----> right-click, export... ---> JAVA ---> select JAR file ---> next --> select the path and name of JAR file --> next --- Select Main class ---> finish.
2. j2se)
Solution 1When other external jar packages are referenced in the proj
Under Linux Execute Jar file method: Enter file directory under command line,execute Java-jar file.jar i.e.Can also create a launcher on the desktop, fill in the command bar related commands: Java-jar/file path/file.jar, so that the desktop double-click to open the Jar fileCreate an executable
Everyone knows that a Java application project can be packaged into a jar, and of course you have to specify a main class with a main function as the program entry for your jar package.
The specific method is to modify the Manifest.mf file in the Meta-inf of the jar package.
For example, there is a jar bag called Tes
We oftenCodeRead some resource files (such as video, music, text, etc ). These simple operations are certainly not problematic when running them separately. However, if we compress the code into a jar package, even if we package the resource files together, these things cannot be found. Take a look at the following code: Java code
//Source code1:
PackageEdu. hxraid;
ImportJava. Io .*;
PublicClassResource {
PublicVoidGetresource ()ThrowsI
Sometimes you need to export the j2se project so that it can operate elsewhere, so you don't have to stick to the feeling of development before it can run.The procedure is as follows:Method 1: (export directly when the project does not reference an external jar package)
Select project ----> right-click, Export... ---> Java ---> JAR file ---> next --> select the path and name of
Java is the most difficult to learn is the corner of the east, is called the Java platform. A search has finally dawned on me.The method of running the. Class directly is JAVA-CP. Com.network.Chat, do not add. class suffixThe jar file that was export from eclipse simply packs the. Class. Therefore, executing this JAR file requires the use of JAVA-CP. Ch04.jar com
Two ways that eclipse will package a Java project that references a third-party jar package into a jar fileScenario One: The export feature that comes with eclipseStep 1: Prepare the master manifest file "MANIFEST." MF ",Because it is a Java project that refers to a third-party jar package, a custom configuration file, MANIFEST.MF, is required to create the file
Detailed jar commandjar {ctxu}[vfm0m] [jar-file] [manifest-file] [-C directory] File name ...where {CTXU} is a subcommand of the jar command, each time the jar command can contain only one of the CTXU, each of which represents:
-C Create a new JAR file package
-
Jar package merge and jar merge
Merge multiple jar packages:
1. First, extract the jar package to be merged to the same directory. Jar xvf xxx. jar
2. Use the jar command to package
Reprint: Http://hxraid.iteye.com/blog/483115?page=3#commentsWe often read some resource files in the code (compared to slices, music, text, etc.). These simple processes are of course not problematic when running alone. However, if we make the code into a jar package, even if the resource files are packaged together, these things will not be found. Take a look at the following code://Source code 1: PackageEdu.hxraid;ImportJava.io.*; Public classResour
Scenario One: The export feature that comes with eclipseStep 1: Prepare the master manifest file "MANIFEST." MF ",Because it is a Java project that refers to a third-party jar package, a custom configuration file, MANIFEST.MF, is required to create the file MANIFEST.MF under the project, which reads as follows:Manifest-version:1.0class-path:lib/commons-codec.jar Lib/commons-httpclient-3.1.jar Lib/commons-lo
What is a JAR file?
The JAR file format is based on the popular ZIP file format used to aggregate many files into one file. Unlike ZIP files, JAR files are used not only for compression and publishing, but also for deploying and encapsulating libraries, components, and plug-ins, and can be used directly by tools such as compilers and JVMs. Include special files
Java dozen jar packages, referencing other. jar Files 2009-06-01 14:39
Everyone knows that a Java application project can be packaged into a jar, and of course you have to specify a main class with a main function as the program entry for your jar package.The specific method is to modify the Manifest.mf fil
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.