• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

extract .rar file with java

 
Eideo Guo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
How do i extract .rar file(Not .zip file) with java?Were there open source?
thanks in advance
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to this a rar file is just a jar file with a different extension. The Java API has classes for handling jar files.
 
Eideo Guo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,but i use java api to reading rar file(winrar compress), it throws

my code as follow:
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the file is a RAR file ? Try opening it using a zip utility.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne, there are two different things called RAR.

What you are referring to are J2EE Resource Archives. These are indeed just JAR files with the extension RAR (just like you have WAR and EAR files in J2EE).

But there's also an archive format called RAR, which is an alternative to ZIP files. Such RAR files are something entirely different than J2EE RAR files. I guess that Eideo means this with RAR files. See http://www.rarlab.com

Sorry Eideo, I don't know of any Java API for RAR files. Have a look at http://www.wotsit.org which does have a link to a document that describes the RAR file format. I have no idea if there are official public specifications on the RAR format or if it's a proprietary format.
 
Eideo Guo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,as Jesper said,i said the RAR files were different from J2EE RAR files.
 
Romi Doshi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone found a solution to this question? If so, please email me... thanks
 
Joe Ess
Bartender
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just taking a stab at this, but how about:

unrar can be found here
 
Hinse ter Schuur
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe this project will do the trick:
http://sourceforge.net/projects/java-unrar/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic