• Advertisement
Sign in to follow this  

One source file used in multiple projects?

This topic is 2193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement