Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading a EAR file

 
Atul Prabhu
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

need to know whether a particluar class ex: Person is present in the ear file or not ?

Actually Person class is present in a jar file within the ear file.

I tried to use java.util.jar package which has a class called JarFile which gives me the list
like this
META-INF/
META-INF/MANIFEST.MF
lib/
lib/cglib-2.0-rc2.jar
META-INF/application.xml
META-INF/sun-j2ee-ri.xml
abc.jar

Actually the Person class is present in abc.jar. The problem is how do I come to know whether Person class exists in abc.jar..

Any suggestions ??( I have to do this programatically not through command prompt)

Regards
Atul
 
Chapoor Chapoor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you solve it ?
I ve the same problem...
Read this...


How can I read the Manifest properties from my code ?

MyEAR.ear
- META-INF/Manifest.mf
- MyJAR.jar <-- code here need to read the manifest above.?

How can I achive this?
The code in MyJAR needs to read the Manifest in the EAR file. How?

Its no problem readig the manifest in the JAR but cant figure out the EAR.

Thanks.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to accomplish?

I mean why do you need to programmatically determine whether a class is within a jar in an ear?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic