Accessing a class from different project
i want to access or get the class which is present in different project.How can i do that?Help
Actually the using reflections i want to access a class from different package. Class class="c开发者_运维技巧lass from another project"
You can use Eclipse IDE which has a facility to add the Project as a dependeny, by which you can use the class you want to access.
You can do that by right clicking on the project and select Buildpath configuration and in that select Projects tab and the project which has a class which you want to use.
Just add the other project (or its JAR file) to your current project's classpath. That should make all of classes from the other project visible in your current project.
For more detail you will have to give more information about the particulars of your setup.
Edit:
No reflection should be needed given the contents of your question but tagging the question "reflection" makes me wonder if perhaps I've misunderstood it.
do you really need java reflection? in your case, classpath para doesn't help?
put /foo/bar/MyClass.class in to your classpath.
I hope I understood your question correctly.
精彩评论