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
In maven, by default, the dependent JAR package is not scored into the executable jar package, and if you need to break the dependency into the executable jar package, you need topomadded inmaven-assembly-pluginplug-ins, this is easy to implement, but it is not recommended in the formal development of such use, why? Because a slightly larger project has at least
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
Package the class into a jar fileFirst, look at the source code of Mainactivity.java and Func.java respectively.Now to package the Func.java into a jar package, here's how:A, right-click Func.java->export->java->jar fileb, select the class to be packaged in the select the resources to export, and note that if this class has calls to other dynamic/static libraries
One, install the Fat jar onlineOnline Installation steps:Eclipse Menu bar Help >software updates >search for new features to install>new update site>Fill in the name and URLName: Any one, write Fat barURL: This is the address input for the fat jar Http://kurucz-grafika.de/fatjarSecond,the use of Fat-jar1, the first step, select the project root node, right-click, select the Build Fat
Recently wrote a LAN project synchronization software, for team development to improve efficiency. In order to run easily with the jar command to pack a bit. You can implement click-to-run.MapThe first step is to compile the Java files into one of your own handy folders,The second step then switches to the current directory to make a second jar commandIt's important to note that if your Java files have a fo
Java modified and packaged back to jar after the jar package has been recompiled
1. Get a jar package to be modified
2. My environment is windows, then unzip this jar package, get a bunch of class files, this time to find the class file you need
3. I first use the Jd-gui tool to look at this class file, then copy it
[Root@master ~]# Hive
Missing Hive execution Jar:/root/hive/hive/lib/hive-exec-*.jar
Display missing hive execution Jar when running hive:/usr/hive/hive-0.11.0/bin/lib/hive-exec-*.jar
Carefully analyze this directory/bin/lib, the two directories in the Hive installation folder are parallel, and the system can find s
Label:Landlord is a novice, followed by a textbook to write a small chat software with the database, and finally finished, in the use of Eclipse to build the jar, but always connect not MySQL, online Baidu visit the forum found that the eclipse's own export can not be packaged with third-party jar, So I began to toss .... =========================================================== 1. Download Fatjar Widget
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
During the project process, use eclipse to compress a jar package and use export --> JAVA --> JAR file. In my jar package, a third-party jar package, such as log4j, I also encountered this problem:
Http://zhidao.baidu.com/question/48376665.html
"Other jar packages are refe
1. Preparatory work:For the sake of convenience, here is an example of Project Class2json in Eclipse, the project structure is as follows:Bin: is based on the execution. Java-generated. class file, the directory under the bin is the same as the SRC directory, except for the. class file Lib: External dependency package src: We wrote it ourselves. java filesNext:1 . We create a new Class2json_jar folder 2 . Copy the files under the bin to Class2json_jar 3 . And the whole LIB to copy the past, the
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
-
The jar command successfully completed the Java-jar command but prompted "No master manifest attribute"! Http://www.bieryun.com/1181.htmlThe jar command successfully completed the Java-jar command but prompted "No master manifest attribute"! I do not understand, I do not know how long before I used the
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
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
The same input jar [*.jar] is specified twice error after upgrading to a higher version of the Android SDK, resulting in confusion failure unable to package a new version of the Proguard package appAfter a day of tossing people to collapse, and eventually I found a solution. Here's how to fix it:
Open Proguard-project.txt
Insert # into #-libraryjars Xxxx.jar before all-libraryjars or delete directly
In NetBeans, you execute clean and Build to get the jar fileTo add a resource to a jar, first open the jar with the compression software and then drag the resource into the current archiveUse class.getresource (String) to refer to a resource in a jarFor exampleHowever, after you execute run in the IDE, you cannot reference the resource because Class.getResource (
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.