• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cant find main

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


compilation executes successfully, yet when running got this:


any help?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your jdk installation & classpath!
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
  •  
    Sheriff
    Posts: 22781
    131
    Eclipse IDE Spring VI Editor Chrome Java Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    author
    Posts: 23951
    142
    jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    reply
      Bookmark Topic Watch Topic
    • New Topic