简体   繁体   English

请参阅jar / war文件以外的课程

[英]Refer to class outside jar/war file

Is it possible that we keep our jar/war file running and one class file in the same directory which can be referred from jar/war? 是否有可能我们将jar / war文件保持运行,并且一个类文件位于可以从jar / war引用的同一目录中? The requirement is I want to keep some common code in single file which can be referred by multiple running jars/wars and I don't have to re-deploy application if I can successfully just change the class file. 要求是我想在单个文件中保留一些公共代码,可以通过多个运行的jar / wars引用,如果我可以成功更改类文件,则不必重新部署应用程序。

I would go for this question here: How should I load Jars dynamically at runtime? 我会在这里提出这个问题: 我应该如何在运行时动态加载Jars?

And them try the answers from jodonnell , chris and allain-lalonde depending on how do you want to access these class files, if by URL or by file path, and if you want to use JAR files or CLASS files. 他们尝试jodonnellchrisallain-lalonde的答案,具体取决于你如何通过URL或文件路径访问这些类文件,以及是否要使用JAR文件或CLASS文件。

In any case you should try and see it for yourself if it fits your needs and is acceptable by your employer standards. 无论如何,如果符合您的需求并且您的雇主标准可以接受,您应该亲自尝试看看。 At certain point, we need to think out of the box. 在某些时候,我们需要开箱即用。 Don't worry if one or other user dislikes this or that approach. 如果一个或其他用户不喜欢这种或那种方法,请不要担心。 This community if meant for ask and receive answers on how to do it, and not to not do it. 这个社区用于询问和接收如何做的答案,而不是不做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM