Note that there are some explanatory texts on larger screens.

plurals
  1. PODo I need to import a package from a jar file after setting the classpath?
    primarykey
    data
    text
    <p>So here is the deal - I downloaded a jar file that I need to communicate with an Allen Bradley PLC. Naturally I set up the CLASSPATH and expected to just be able to create a program with a constructor from one of the classes in the jar file and go about my way. This was not the case.</p> <p>Here is my CLASSPATH:</p> <pre><code>nick@ubuntu:~/Java/PLC Program$ echo $CLASSPATH /home/nick/Java/PLC Program/ethernetip4j-0.2.jar </code></pre> <p>Here is the code in my program:</p> <pre><code>ControlLogixConnector test = new ControlLogixConnector(ENBTIP,44818); </code></pre> <p>I compile and get the following errors:</p> <pre><code>nick@ubuntu:~/Java/PLC Program$ javac PLCServer.java PLCServer.java:13: error: cannot find symbol ControlLogixConnector test = new ControlLogixConnector(ENBTIP,44818); ^ symbol: class ControlLogixConnector location: class PLCServer PLCServer.java:13: error: cannot find symbol ControlLogixConnector test = new ControlLogixConnector(ENBTIP,44818); ^ symbol: class ControlLogixConnector location: class PLCServer 2 errors </code></pre> <p>I have my program and jar file in the same directory. Do I need to import any package that is in the jar file or am I missing something else completely different?</p> <p>Thanks in advance</p> <p>EDIT:</p> <p>Here is my code:</p> <pre><code>import java.io.*; import java.net.*; import se.opendataxchange.ethernetip4j.clx.ControlLogixConnector; class PLCServer { public static void main(String argv[]) throws IOException { // IP address of the ethernet card String ENBTIP = "192.168.10.14"; ControlLogixConnector test = new ControlLogixConnector(ENBTIP,44818); } } </code></pre> <p>I get errors saying the se.opendataexchange.ethernetip4j.clx.ControlLogixConnector doesn't exist and the ControlLogixConnector object doesn't exist (compiled with javac PLCServer.java). </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload