I have several Java apps that run directly from the a shared d开发者_高级运维rive 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
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/Tasks/sync.html
http://ant.apache.org/manual/Tasks/java.html
精彩评论