Guillermo
Guillermo

Reputation: 51

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.

Upvotes: 1

Views: 3574

Answers (2)

RuntimeException
RuntimeException

Reputation: 1643

If you are using JEasyOpc inside a web application (e.g. 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]

Upvotes: 1

karakuricoder
karakuricoder

Reputation: 1075

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 .

Upvotes: 0

Related Questions