Skip to main content
GameDev.net gamedev.net
🔒 Locked

One source file used in multiple projects?

Started by Belgium Jan 20, 2012 at 8:19 PM 3 replies 2.8k views
Original Post
Belgium
Belgium
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
way2lazy2care
way2lazy2care

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.
Belgium
Belgium

stick it in a jar.


Thanks. That does the trick.
Danny02
Danny02

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)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.