I am new to Java and was hoping someone could help me with this issue.
I have set up a project in eclipse; and have three packages: Client, Interfaces, and Server.
When I run the server as java application (through eclipse), it launches fine. If I then run the client as java application through eclipse the results are exactly as I would expect.
I am now trying to run them through the command line. First I created a jar containing all my Interfaces *.class files
I am now trying to compile the Server.java file, but it is saying that package Interface does not exist.
So currently I have:
src/Interfaces
|--inter1.java
|--inter2.java
|--inter1.class
|--inter2.class
|--inter12.jar
|--inter1.class
|--inter2.class
src/Server
|-myServer.java
|-fileThat'myServer.java'dependson.java
src/Client
|-myClient.java
And in myServer.java I have for example:
package Server
...
import Interfaces.inter1;
It appears I am breaking the package structure trying to run this; thus far I have tried several things, including
java -cp ../Interfaces/inter12.jar: myServer.java
which throws "Exception in thread "main" java.lang.NoClassDefFoundError: myServer/java"
Any help is appreciated, I am admittedly a little lost here and the more I read the more confused I get.
EDIT: I cannot compile the myServer.java; on running 'javac myServer.java' I get:
myServer.java:8: package Interfaces does not exist
import Interfaces.inter1;