| | |
Shared class in java.
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 46
Reputation:
Solved Threads: 1
I have many projects in a software. Although some files and classes are shared within these projects, there are classes used by most of these projects. How do i creat classes that can be shaed among different projects . Is there anything in java that can function the same as 'modules' in vb.net?
Thanks a lot.
Thanks a lot.
Create a seperate Project with some classes and then you can import these classes like you import any other class:
The only difference is that you will be importing your classes with their packages.
You can take the .class files (in their folder/package) or create a jar file with the classes. Then add that to the classpath of the project you want them to be used.
Java Syntax (Toggle Plain Text)
import java.util.*
The only difference is that you will be importing your classes with their packages.
You can take the .class files (in their folder/package) or create a jar file with the classes. Then add that to the classpath of the project you want them to be used.
Check out my New Bike at my Public Profile at the "About Me" tab
Dear,
Create .jar of those classes you want to use them in different projects and append the entry of .jar file CLASSPATH environment variable.
PS:
You can place .jar files in \jdk1.6.0\jre\lib\ext . (shared folder of jvm - am I?, Mr. Ancient Dragon.).
Create .jar of those classes you want to use them in different projects and append the entry of .jar file CLASSPATH environment variable.
PS:
You can place .jar files in \jdk1.6.0\jre\lib\ext . (shared folder of jvm - am I?, Mr. Ancient Dragon.).
Failure is not fatal, but failure to change might be. - John Wooden
![]() |
Similar Threads
- java assignment problem- need pro helps. (Java)
- Need help with Array sorting using Java Servlet (Java)
- Why there is no "local static variable" in JAVA is any alternate available for that (Java)
- Java script errors with IE & Mozilla (Web Browsers)
- java database connectivityl (Java)
- IE shuts down and leaves message on desktop (Viruses, Spyware and other Nasties)
- Hijackthis report, I just don't know (Viruses, Spyware and other Nasties)
- 62.214.197.166 wants to send email through java (Viruses, Spyware and other Nasties)
- JAVA OPENSTR.A & Trojan.ByteVerify (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: Java Help
- Next Thread: hey everybody,m an it student from india,n I'm in great trouble.Pls help!
| Thread Tools | Search this Thread |
android api applet application array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) chat class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse editor error errors event eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress input integer intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia link linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle parsing plazmic print problem program programming project recursion scanner screen server set sharepoint size smart sms smsspam sort sortedmaps sql string subclass support swing threads time tree unlimited utility webservices windows






