How to create my own utility classes in Eclipse?
I'm a student, so please bear with me!
I've got some introductory Java (us开发者_JAVA百科ing BlueJ) but I'm taking a Java course and using Eclipse. I'm working on my homework, and each week's lab builds on the previous week. I'm finding that it would be useful to create a couple of my own utility classes that I can import into my lab projects, rather than having the same classes coded into every project.
I can't figure out how to do this correctly, however. In my project's build path I've used the "link source" function to point to the project folder where my utility class lives, but I still get a message from Eclipse that it can't resolve the import.
Can someone point me in the right direction? I've reviewed the answers to similar questions but no joy.
Thanks, dean
You can create multiple projects in Eclipse. Put your utility classes into one project. Then when you create a new project for an assignment, add the utility project to the "Java Build Path" (right-click the project, choose "Properties".) The assignment classes will then have the utility classes available.
精彩评论