One source file used in multiple projects?

Started by
3 comments, last by Danny02 12 years, 3 months ago
Hi,

I've written a few classes in java which are useful in multiple projects. Unfortunately, without copy/pasting them I haven't been able to figure out how to use the classes in multiple projects.

In C++ I would just include the .h file and make sure the compiler knew where to look for it.

However, using Netbeans for my Java, I receive a "Package Folder Already Used in Project" message. How can I have just one source file but use it in multiple projects?

Thanks
Advertisement

Hi,

I've written a few classes in java which are useful in multiple projects. Unfortunately, without copy/pasting them I haven't been able to figure out how to use the classes in multiple projects.

In C++ I would just include the .h file and make sure the compiler knew where to look for it.

However, using Netbeans for my Java, I receive a "Package Folder Already Used in Project" message. How can I have just one source file but use it in multiple projects?

Thanks

stick it in a jar.

stick it in a jar.


Thanks. That does the trick.
C# is way easier, there's a button wher you can link it. in VStudio.

C# is way easier, there's a button wher you can link it. in VStudio.

this has nothing todo with the language.


In Netbeans u can set another project as a dependencie.(project->preferences->libarys->add project)

This topic is closed to new replies.

Advertisement