I have two classes ChatClient
and Listener
and want to comile and run them. In eclipse it works fine, but on terminal I can't get it run.
Both classes are on the path: /Desktop/java/task4
.
Maybe I should mention that inside the ChatClient
class a Listener
Object gets created.
I compile the two classes with the command: javac *.java
and get 2 classes created. But if I type java ChatClient
I get the error main class could not be found or loaded
. What am I doing wrong? I'm using Ubuntu. And yes there is a main
method inside ChatClient
public class Listen extends Thread {
Socket s;
Scanner msg;
public Listen(Socket s) {
....
}
public class Chatter {
public static void main(String[] args) {
try {
...
Listener lt = new Listener(s);
...
}