aspose file tools
The moose likes Java in General and the fly likes cant find main Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply 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: 4163
    
    3

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: 19214

    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
    How To Ask Questions How To Answer Questions
    Henry Wong
    author
    Sheriff

    Joined: Sep 28, 2004
    Posts: 16680
        
      19

    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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: cant find main
     
    Similar Threads
    public class for calling main
    String array with null or """
    for loop
    Static initialiser
    RHE Final #27