• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

displaying information from JAR file

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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());
}
}
}
reply
    Bookmark Topic Watch Topic
  • New Topic