简体   繁体   English

我不知道如何在Java中安装JEasyOPC

[英]I don't know how to install JEasyOPC in Java

I'm trying to read signals from a PLC trough Java, and for that I think I should use a "bridge" called JEasyOPC . 我正在尝试通过Java通过PLC读取信号,为此,我认为我应该使用一个称为JEasyOPC的“桥”。 The problem is that I don't how to install it, and make it work. 问题是我没有如何安装它并使它正常工作。

I followed a tutorial but I get always stuck at the same problem. 我遵循了教程,但始终陷入同样的​​问题。 I get an error: 我收到一个错误:

Property file javafish.clients.opc.JCustomOpc doesn't exist. 属性文件javafish.clients.opc.JCustomOpc不存在。 System terminated. 系统终止。

If you are using JEasyOpc inside a web application (eg inside a .war file), then you may need to do the following 如果在Web应用程序(例如.war文件)中使用JEasyOpc,则可能需要执行以下操作

Replace this line in PropertyLoader.java with 将PropertyLoader.java中的这一行替换为

ClassLoader cl = ClassLoader.getSystemClassLoader();

with

ClassLoader cl = PropertyLoader.class.getClassLoader();

Also, make sure you specify -Djava.library.path=[path to folder containing dll] 另外,请确保指定-Djava.library.path=[path to folder containing dll]

The property file is in a directory called resources. 该属性文件位于称为资源的目录中。 If you have the jeasyopc.jar in a directory, /jeasy, then the resources directory should be in a directory such as /jeasy/resources. 如果在/ jeasy目录中有jeasyopc.jar,则resources目录应该在/ jeasy / resources等目录中。 You need to put this on your classpath. 您需要将此放在您的类路径上。 This can be done in your environment or at run time with something like java -Djava.ext.dirs=.:/jeasy/resources . 这可以在您的环境中或在运行时使用java -Djava.ext.dirs =。:// jeasy / resources之类的方法完成。

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

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