Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2008, 07:59 PM
Member
 
Join Date: Jul 2008
Posts: 4
zenner is on a distinguished road
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
Sponsored Links
  #2 (permalink)  
Old 07-29-2008, 04:08 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 337
fishtoprecords is on a distinguished road
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
Sponsored Links
Reply


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

vB 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 08:54 PM
how to access shared file/folder in LAN ksheetiz Networking 2 05-24-2008 05:54 AM
Shared Scientific Toolbox in Java 1.01 Java Tip Java Announcements 0 05-08-2008 07:53 PM
Shared Scientific Toolbox in Java 1.00 Java Tip Java Announcements 0 04-10-2008 05:16 PM
Shared Scientific Toolbox in Java 0.99 JavaBean Java Announcements 0 03-16-2008 09:38 PM


All times are GMT +3. The time now is 02:34 AM.


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