Results 1 to 2 of 2
- 07-25-2008, 06:59 PM #1Member
- Join Date
- Jul 2008
- Rep Power
how to create shared classes project .. and SHARE
I have several classes that I wish to reuse in many of my projects.
I creating a Java (netbeans) project and compiled them.
THEN in another project, I tried to add the shared source folder (where the classes where located in the previous project)
to this 2nd project. NETBEANS gave me an error, said a folder can only be in one project...
how then can I share these classes in other projects?
- 07-29-2008, 03:08 AM #2
Create one as a library. It can have main() functions in some of the classes if you want. Have NetBeans make a jar file of the library.
Then make a new project. Use the "library" function of the project's Properties to point to the JAR file from the other project.
This will not automatically recreate the library/jar when you change it for the second, so you have to make changes in the library code, compiler it to "build" the jar, and then go to the second project.
With Netbeans, you don't have to close each project, just select it and "build"
- By Java Tip in forum SWT TipsReplies: 0Last Post: 07-02-2008, 07:54 PM
- By ksheetiz in forum NetworkingReplies: 1Last Post: 05-24-2008, 04:54 AM
- By Java Tip in forum Java SoftwareReplies: 0Last Post: 05-08-2008, 06:53 PM
- By Java Tip in forum Java SoftwareReplies: 0Last Post: 04-10-2008, 04:16 PM
- By JavaBean in forum Java SoftwareReplies: 0Last Post: 03-16-2008, 09:38 PM