Results 1 to 3 of 3
Thread: Use classes without recompiling?
- 08-01-2007, 04:30 PM #1
Member
- Join Date
- Aug 2007
- Posts
- 6
- Rep Power
- 0
Use classes without recompiling?
Hi, I have a situation where I'd like to use classes without having to compile them into my program (they may be created afterward). My program knows the superclass, so I am creating them with Class.forName and invoking the constructor then casting the resulting object.
However, simply giving the class name as a string doesn't tell my program how to actually find the classes. I thought of uncompressing the jar file, adding the classes to the manifest and then recompressing the jar file, which is better than having to recompile, but I'd prefer something simpler, like editing a file outside of the jar.
Is there a simple way to do this?
- 08-02-2007, 12:33 AM #2
Senior Member
- Join Date
- Jul 2007
- Posts
- 135
- Rep Power
- 0
As long as the classes are in the class path your good to go. You could put your classes in one jar and then the others that come later you could put in a second jar file. As long as both are in the classpath when your program starts everything should be good.
You could also use the Class-Path: option in your manifest to include the other jar as well.
- 08-02-2007, 11:26 AM #3
Member
- Join Date
- Aug 2007
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Using a JAR from other classes
By Joe2003 in forum Advanced JavaReplies: 1Last Post: 01-02-2008, 07:08 PM -
Objects and Classes
By Aleve in forum New To JavaReplies: 8Last Post: 12-31-2007, 08:05 AM -
Help for dynamic classes
By Bender in forum Advanced JavaReplies: 1Last Post: 12-19-2007, 08:46 PM -
When do we use inner classes?
By cruxblack in forum New To JavaReplies: 5Last Post: 08-10-2007, 05:00 PM -
EJB, classes Model
By Felissa in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 07-06-2007, 03:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks