开发者

Getting a Class from another project programatically

I want to access a class which is present in another project . For that i use java reflections,but first i need to get the class object which is in another project.I want to get it programatically.I can do that like right click on my project then go to build configure path and then to project tab and add project.I want to do it programmatically .H开发者_如何学Pythonow can i do that?Help


You need a custom class loader.

tutorial link1

tutorial link 2


I think you can do it by creating a jar of the dependent project and adding it to class path before you run your application.


It seams you are working in eclipse and want do use the classes from projet B in projet A, is it so? If so you could specify in eclipse that project A depends from project B by adding the project in the 'java build properties'. Do get the right answer, you ask to be more specific in your question like Steven wrote.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜