views:

13

answers:

1

I have several Java apps that run directly from the a shared drive on the LAN. This has worked fine until recently when we setup a remote office on a VPN. The actual applications are small, but have nearly 20 megs of dependencies in their classpath.

Is there a way to continue to run the applications from the network, but cache the dependent jars on the local machine?

Thanks,

David

A: 

There are some unanswer doubts about your question. For now I would recommend below solution.

  • Use Ant script to launch your java applications
  • Reserve a folder on local drive to cache libraries and have it on classpath in ant script
  • Before launching application, have sync ant-task that will synchronize libraries from network drive to your cache.
  • Use libraries from cache location in class path instead of libraries from network drive

ant sync task helps you overwrites all files in destination with newer files from source and deletes files from destination that are not present in source.

Reference:

http://ant.apache.org/manual/CoreTasks/sync.html

http://ant.apache.org/manual/CoreTasks/java.html

Gladwin Burboz