File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying information from JAR file

 
Manu Verma
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want make such Java program which can display all classes and their methods & constructors of given Package, also it can read from JAR file.

Means, either I give package path or JAR file path, it should display all contains classes, methods and constructors.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

So where are you stuck implementing this? Do you have a specific question?
 
Manu Verma
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
I am working on application which requires the specific, actually I have made this, which displays classes and methods of a particular given method, but it doesn't work for JAR files, and I want to make it for JAR files also.

p


[ UD: Please UseCodeTags ]
[ October 16, 2007: Message edited by: Ulf Dittmer ]
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any code that would open a jar file and access its contents. You can use the java.util.jar.JarFile class for this.
[ October 16, 2007: Message edited by: Ulf Dittmer ]
 
Manu Verma
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton, I have used this and code is working fine -
public class JarFileInfo {

public static void main(String args[]) throws IOException{
JarFile j = new JarFile("abc.jar");
Enumeration e = j.entries();
while(e.hasMoreElements()){
System.out.println(e.nextElement());
}
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic