Sign in to follow this  
Belgium

One source file used in multiple projects?

Recommended Posts

Belgium    123
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
way2lazy2care    790
[quote name='Belgium' timestamp='1327090780' post='4904666']
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
[/quote]
stick it in a jar.

Share this post


Link to post
Share on other sites
Danny02    279
[quote name='szigeti_roland' timestamp='1327109195' post='4904734']
C# is way easier, there's a button wher you can link it. in VStudio.
[/quote]
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this