aspose file tools*
The moose likes Java in General and the fly likes Identifying when a jar file is added at the runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Identifying when a jar file is added at the runtime" Watch "Identifying when a jar file is added at the runtime" New topic
Author

Identifying when a jar file is added at the runtime

Bhagirathi Mallick
Greenhorn

Joined: Jul 21, 2011
Posts: 26
Is there any listener class to identifying when a jar file is added at the run time into our application...

if not ,then how can i acheive that...

thanks in advance
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3953
    
  17

Yes, there is a WatchService available in the java.nio package (for Java 1.7+) which will do what you need (other classes that will be good to read: java.nio.Paths, java.nio.Watchable, java.nio.FileSystem, and java.nio.Path).


Steve
Bhagirathi Mallick
Greenhorn

Joined: Jul 21, 2011
Posts: 26
Actually i am using java 6 .
Is there any listener method in java 6 to notify when a jar file as added or removed from your project at the run time.
so please replay..
thanks..
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3953
    
  17

No, you will have to update or roll your own.
 
Don't get me started about those stupid light bulbs.
 
subject: Identifying when a jar file is added at the runtime
 
Similar Threads
TLD file location.
Mimic Browser Httprequests & posts
cp not being recognised
Datasource configuration in Tomcat
java.lang.ClassNotFoundException: javax.mail.MessagingException