Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2008, 06:59 PM
Member
 
Join Date: Jul 2008
Posts: 4
Rep Power: 0
zenner is on a distinguished road
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?

thanks
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-29-2008, 03:08 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 571
Rep Power: 2
fishtoprecords is on a distinguished road
Default
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"
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create your own dialog classes in SWT Java Tip SWT 0 07-02-2008 07:54 PM
how to access shared file/folder in LAN ksheetiz Networking 2 05-24-2008 04:54 AM
Shared Scientific Toolbox in Java 1.01 Java Tip Java Announcements 0 05-08-2008 06:53 PM
Shared Scientific Toolbox in Java 1.00 Java Tip Java Announcements 0 04-10-2008 04:16 PM
Shared Scientific Toolbox in Java 0.99 JavaBean Java Announcements 0 03-16-2008 08:38 PM


All times are GMT +2. The time now is 04:10 PM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org