• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read a class file from jar  RSS feed

 
Kousik Majumder
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can some body tell me how can I read the class file(containing main method) from a jar file ?


Thanks,

Kousik
 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you just want to execute a program from a jar file then you can use "java -cp myjarfile.jar packagename.ClassName" (add parameters if needed). If you want to load the class into memory from another program you should probably look at the java.util.jar package.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!