Results 1 to 2 of 2
  1. #1
    zenner is offline Member
    Join Date
    Jul 2008
    Rep Power

    Default 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?


  2. #2
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    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"

Similar Threads

  1. How to create your own dialog classes in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 07:54 PM
  2. how to access shared file/folder in LAN
    By ksheetiz in forum Networking
    Replies: 1
    Last Post: 05-24-2008, 04:54 AM
  3. Shared Scientific Toolbox in Java 1.01
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 05-08-2008, 06:53 PM
  4. Shared Scientific Toolbox in Java 1.00
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-10-2008, 04:16 PM
  5. Shared Scientific Toolbox in Java 0.99
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-16-2008, 08:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts