Today, when I write a project, I import a jar file that I wrote, and I can't find the jar file error when I debug it:08-06 21:42:10.744:e/androidruntime (2578): java.lang.RuntimeException:Unable to instantiate activity componentinfo{ Com.example.iotlife/com.example.iotlife.mainactivity}: Java.lang.ClassNotFoundExceptio
Use the java.util.zip. zipfile class to decompress the file.
You can decompress the zip, jar, and war files, but cannot decompress the rarfile.
import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.util.Enumeration;import java.util.zip.ZipEntry;import java
1. first introduce the development environment:
I used mave2.1 and jdk1.7, and installed the svn client.ProgramAnd subversion. In the project, I used the previous Maven library. The default is the. m2/respository directory of the current user under drive C,
The following error occurs during compilation:
2. The error message is as follows:[Info] ------------------------------------------------------------------------[Error] Build failure[Info] ------------------------------------------------
Need to write a file compression program in Java, First prepared to use the Java library in the Java.util.zip.ZipOutputStream, but a search, found that there is a problem with Chinese garbled, so the use of org.apache.tools.zip.ZipOutputStream.
Because of the code built with the MAVEN2, it's convenient to look for a package and download the latest Ant-1.8.1.jar package. During the reference to a piece of ar
What is the difference between an Ear, Jar, and war file? What kind of environment they are used separately.
In the file structure, the three are not different, they are in the zip or jar file compression format, but they use dif
Error problem: Although the Find repository directory is a jar package, but the jar package is problematic (perhaps the download is incomplete), so change the mirror address to the domestic.Solution:1) Remove all jar packages under the error path (C:\Documents and settings\administrator\.m2\repository\org ... )。2) Change the image address, preferably into a domes
file:
If you use the API or other ancillary resources provided by the third party during the development of the program, you must export the files of the third party when you export the generated jar files, or your program will not run to the desired results.
You can use the Fat jar plugin to generate the download address for the
Cause using the Eclipse+maven build project after build, an exclamation mark is displayed on top of the project. Open problem Displays the reason for the corresponding jar package corruption.: Solution
Use a different version of the jar package
Find the problem jar package to replace yourself online
Added about the fact that it is possible to remove thi
Reprint: http://blog.csdn.net/dingmingxin/article/details/6948673
Users who have used Ubuntu know that compressed zip files under windows are unzipped with the archive manager under Ubuntu,
will appear in Chinese garbled. Find a solution in the Internet jar, there are several kinds of oh, I think the following is suitable for my own solution
File:
Popular handy compression tool, support mouse drag and drop and shell expansion, perfect support ZIP file, built-in program can unlock CAB, ARJ, LZH, TAR, GZ, ACE, UUE, BZ2, JAR, ISO and other types of compressed files; You can compress the file before the zip and RAR two ki
Apache ant has a package dedicated to processing ZIP files. You can specify the file name encoding method. This can solve the problem.
For example, use org.apache.tools.zip.zipoutputstreamto replace java.util.zip. zipoutputstream.
Java uses Unicode as the basis for text encoding. Therefore, if zipinputstream and zipoutputstream are used to compress and decompress data, it must be UNICODE when it comes to th
avoid errors)
--------------------------------------------
Manifest-Version: 1.0
Created-By: 1.4.1 _ 02 (Sun Microsystems Inc .)
--------------------------------------------
Then use the jar command to generate an executable jar file, for example:
(Go to the Directory D:/chat/before executing this command /)
Jar cvf
This article mainly introduces the method of reading data from Java JAR file, and analyzes the related operation skills of Java files, and the friends who need it can refer to the following
The example in this article describes how to read data from a Java jar file. Share to everyone for your reference. as follows:
T
When uploading the jar mobile game client, some mobile phones, such as some Samsung models, can only install Jad files, so you need to obtain a function to automatically generate Jad Based on the JAR file during background upload. Generally in the jar file package, there wil
The example in this article describes how to read data from a Java jar file. Share to everyone for your reference. Specifically as follows:
The Java archive (Java Archive, JAR) file is a packaged solution based on Java technology. They allow developers to package all relevant content (. class, pictures, sounds, and su
This is an article that describes how to make a self-extracting jar file, the author through a self-extracting program, and the self-extracting program and a manifest file into the original jar file, to produce a variety of Java-enabled platform to run the self-extracting
the jar command to generate executable jar files, for example:(Go to the Directory D:/chat/before executing this command /)Jar cvfm cal. jar manifest. mf *. classJar usage: (for reference only. skip this part for beginners)Jar {ctxu} [vfm0Mi] [
return GetFile (New URL (resourcelocation));
The catch (Malformedurlexception ex) {//no URL-> treat as file path return new File (resourcelocation); }
}
Look at the structure of the Code simple logic clear, there may be a problem is the icon Red 2. Here my first impression was that the class loader did not load the resource when it was loaded. Debug the class loader for Cl.getresource (path
Method 1:In eclipse, you can export jar files (similar to EXE files, but supported by Java Virtual Machine) and execute file → export → jar (runable.Eclipse --> right-click a Java project --> export --> JAVA-JAR file/runnable JAR
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.