how to get the complete classpath using java code

hi friends

i am developing an application in which i am using reflection,i have to read a

classpath that jvm generates using reflection ,i usedsystem.property("java.class.path"); but its getting the jar files ,but i need the.class file to be displayed on the classpath ,how to get it .

thanks

[318 byte] By [nandashivaa] at [2007-11-27 8:44:55]
# 1
Classpath doesn't contain class' files. It contains directories and jar files. You need to scan specified objects by yourself to get all possible classes.
Michael.Nazarov@sun.coma at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...
# 2
is there any way to get the classpath using reflection in java1.4
nandashivaa at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...
# 3
I don't know. What for?
Michael.Nazarov@sun.coma at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...
# 4
i am using reflection in my application so from the classpath i should get classfiles using reflection
nandashivaa at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...
# 5
Simply saying "reflection" over and over again won't help
georgemca at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...
# 6

> i am using reflection in my application so from the

> classpath i should get class

> files using reflection

I am guessing you have no idea what you are doing.

I can only suppose that you want to span the directories that are in the class path and look for class files.

If so...

1. You get the class path

2. You split it.

3. For each path you look for class files in that directory.

4. For each jar you use the api to open the jar and look for class files in that. You might want to consider that jars can contain jars.

5. For each class file found in 3 and 4 you must parse the class structure to determine the fully qualified file name.

6. You display that list.

Note that it much easy to just require a configuration file that specifies the fully qualified names.

jschella at 2007-7-12 20:45:52 > top of Java-index,Java Essentials,New To Java...