简体   繁体   English

无法在Java Swing中访问Jar外部的公共变量

[英]Can't access Public variable Outside Jar in Java Swing

I have a public static variable in class A this class is defined in Jar A. I am try to call this variable in Class B in Jar B.The source code of Jar A is attached as a relative path to jar B.Before every thing was working fine and i can access public variables of Class A of Jar A in Class B of Jar B . 我在A类中有一个公共静态变量,该类是在Jar A中定义的。我尝试在Jar B中的B类中调用此变量.Jar A的源代码附加为jar B的相对路径。运行良好,我可以访问Jar B的B类中Jar A的A类公共变量。 But now the new defined variable is not seen in Class B of Jar B. I have clean and rebuild the jar A several times and paste in lib of jar A but nothing works for me. 但是现在在jar B的B类中看不到新定义的变量。我已经清理并重建了jar A几次,并粘贴到jar A的lib中,但是对我没有用。 Lots of thanks in advance. 提前非常感谢。

我找到了解决问题的方法,我将jar A粘贴到Jar B的dist文件夹的库中,而粘贴到Jar B的主库中解决了我的问题。

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

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