Results 1 to 8 of 8
Thread: problem with jar file
- 11-09-2008, 01:30 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
problem with jar file
Hello,
I work on a web archiving project.
The archived files have a specific format called ARC.
for now I need to extract links from an ARC file. For that I found on the Internet a code that make what I want
But the problem is that I want to make some changes in this code which is in a package called: org.archive.modules.extractor
So I compiled the source : ExtractorARC.java
as follows:
and I put the generated ExtractorARC.class in the crawler.jar file after extracted it in this path: org.archive.modules.extractorjavac -cp crawler.jar ExtractorARC.java
but now when I run my class like this:
I get this error:ava -cp crawler.jar org.archive.modules.extractor.ExtractorARC 1.arc.gz
Exception in thread "main" java.lang.NoClassDefFoundError: org/archive/modules/extractor/ExtractorARC
I do not see where is the problem.
What i must do please, do you have an idea.
Regards :(
- 11-09-2008, 02:13 PM #2
Did you include the full package path to the class file? The jar command should be issued when you are in the folder containing the org folder.I put the generated ExtractorARC.class in the crawler.jar
Look in the jar file and see if the class file has the full path.
- 11-09-2008, 02:20 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
yes it has the full path
- 11-09-2008, 02:37 PM #4
"Then it should work, unless ...."
If the jar file is in the current folder when the java command is issued and the class name in the jar file has the full package path to the class file and you've spelled the package path to class file correctly, then ...
Could you copy and paste the full text of the console when you try executing the program? If on windows do a dir before the java command.
- 11-09-2008, 03:06 PM #5
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
there is the message error I got:
Exception in thread "main" java.lang.NoClassDefFoundError: org/archive/modules/extractor/ExtractorARC
- 11-09-2008, 04:11 PM #6
DO NOT EDIT or remove anythingcopy and paste the full text of the console when you try executing the program? If on windows do a dir before the java command.
- 11-09-2008, 04:46 PM #7
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
There is the full error message: :)
Exception in thread "main" java.lang.NoClassDefFoundError: ExtractorARC
- 11-09-2008, 06:46 PM #8
YOU are NOT copying the FULL console showing the dir. Also do: jar tf crawler.jarcopy and paste the full text of the console when you try executing the program? If on windows do a dir before the java command.
Then copy the FULL CONTENTS of the console, do NOT EDIT it or remove anything. I need to see what you entered and the results.
It should look like this:Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:\JavaDevelopment\Testing>dir *.jar
Volume in drive D is Work
Volume Serial Number is 1463-F5AE
Directory of D:\JavaDevelopment\Testing
10/09/2005 09:42 AM 2,843 AppletCommBullet.jar
10/09/2005 09:42 AM 1,784 AppletCommMain.jar
05/26/2002 03:52 PM 18,634 AppletToDB.jar
10/13/2008 09:07 AM 2,492 GetResource.jar
05/30/2001 10:51 AM 4,633 JarCreator-src.jar
05/30/2001 10:51 AM 8,189 JarCreator.jar
10/17/2001 02:54 AM 1,891,692 java40.jar
09/03/2008 08:48 AM 654 MTResources.jar
06/03/2008 06:34 PM 26,180 MyJavaClasses.jar
05/30/2001 05:12 PM 4,363 PaintAllExample.jar
05/18/2002 08:28 AM 7,588 ScrollItUp.jar
01/28/2008 02:38 PM 94,578 servlet-api.jar
06/21/2001 12:57 PM 1,786 Test.jar
08/17/2005 01:44 PM 1,884 Testing2.jar
06/07/2002 09:57 AM 910 TestPackage.jar
15 File(s) 2,068,210 bytes
0 Dir(s) 20,670,808,064 bytes free
D:\JavaDevelopment\Testing>java -cp Testing.jar asdf
Exception in thread "main" java.lang.NoClassDefFoundError: asdf
D:\JavaDevelopment\Testing>jar tf Testing.jar
java.io.FileNotFoundException: Testing.jar (The system cannot find the file spec
ified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.jav a:106)
at java.io.FileInputStream.<init>(FileInputStream.jav a:66)
at sun.tools.jar.Main.run(Main.java:184)
at sun.tools.jar.Main.main(Main.java:903)
D:\JavaDevelopment\Testing>jar tf Test.jar
ByteStringByte.class
D:\JavaDevelopment\Testing>Last edited by Norm; 11-09-2008 at 06:48 PM.
Similar Threads
-
problem - using a jar file
By jon80 in forum New To JavaReplies: 6Last Post: 07-07-2008, 07:49 AM -
[SOLVED] file i/o problem
By aytidaalkuhs in forum New To JavaReplies: 3Last Post: 04-06-2008, 06:42 PM -
problem with jar file pls help
By jinu5 in forum New To JavaReplies: 0Last Post: 08-15-2007, 10:41 PM -
Problem in batch file
By marwa in forum New To JavaReplies: 0Last Post: 08-14-2007, 10:24 AM -
problem when I try to delete a file
By tommy in forum Advanced JavaReplies: 2Last Post: 07-31-2007, 02:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks