aspose file tools*
The moose likes Java in General and the fly likes cant find main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "cant find main" Watch "cant find main" New topic
Author

cant find main

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239


compilation executes successfully, yet when running got this:


any help?
Murtaza Lokhandwala
Ranch Hand

Joined: Jan 28, 2010
Posts: 35
Check your jdk installation & classpath!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

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.


  • luck, db
    There are no new questions, but there may be new answers.
    Rob Spoor
    Sheriff

    Joined: Oct 27, 2005
    Posts: 19755
        
      20

    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


    SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
    How To Ask Questions How To Answer Questions
    Henry Wong
    author
    Sheriff

    Joined: Sep 28, 2004
    Posts: 18962
        
      40

    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


    Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: cant find main