• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cant find main

 
Hendra Kurniawan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


compilation executes successfully, yet when running got this:


any help?
 
Murtaza Lokhandwala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your jdk installation & classpath!
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code shows a class named Main. The console screenshot pertains to not being able to locate the class TimeServerPublisher.

You need to tell us
  • the name of the file in which your class code is saved.
  • the exact command you issued to get that error.
  •  
    Rob Spoor
    Sheriff
    Pie
    Posts: 20613
    63
    Chrome Eclipse IDE Java Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Darryl Burke wrote:The console screenshot pertains to not being able to locate the class TimeServerPublisher.

    Hendra, the class name you've given to the JVM is TimeServerPublisher.class. That's not a class name though, that's a file name. To run a class the full class name should be given, for the test code that's com.testing.main.Main
     
    Henry Wong
    author
    Marshal
    Pie
    Posts: 21446
    84
    C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Others have already pointed this out -- but I thought this should be mentioned.

    This error isn't saying that it can't find main(). This error is saying that the main thread can't find the class at all. The "main" mentioned here is not referring to the main method.

    Henry
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic