简体   繁体   中英

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 . 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. System terminated.

If you are using JEasyOpc inside a web application (eg inside a .war file), then you may need to do the following

Replace this line in PropertyLoader.java with

ClassLoader cl = ClassLoader.getSystemClassLoader();

with

ClassLoader cl = PropertyLoader.class.getClassLoader();

Also, make sure you specify -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. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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