0

Receiving this error in xterm, despite class file being in the current directory. I have looked at a lot questions previously asking about this, but they're mainly concerned with packages and/or incorrect CLASSPATH referencing at the command line. These answers supplied by previous members have not been helpful in my situation as I would assume since I'm working from the one directory, the default classpath would just be that. My directory contains the following after compilation

Cdht_ex$PingTask.class Cdht_ex$TCPServerThread.class Cdht_ex$UDPServerThread.class Cdht_ex.class Cdht_ex.java

and after running at the command line the following (The program also takes 3 values for the remaining arguments)

..java3$ java Cdht_ex 5 6 10

I receive the following error

Error: Could not find or load main class Cdht_ex

I have not used packaging, and have all my files residing in the current directory. I have a main function defined as well as obviously a public class, Cdht_ex .

sebajun
  • 51
  • 8
  • If you disagree with my assessment, then at least provide all code and other information necessary to reproduce this (a [mcve]). I would guess your problem is either #2b or #3 from the accepted answer on the duplicate. – Mark Rotteveel May 22 '18 at 13:52
  • Why assume? Test! Provide a classpath. Try `java -cp . Cdht_ex 5 6 10` – Erwin Bolwidt May 22 '18 at 14:23

0 Answers0