Menu

Couldn't find main class

Help
2002-04-06
2002-06-05
  • Heinz König

    Heinz König - 2002-04-06

    Hi, same problem here as tigershark. When
    I run MarsProject.bat I get the error message
    "Couldn't find main class"

    Can't wait to play Marsproject!

    Regards
    hkoenig

     
    • David

      David - 2002-04-06

      Hate to tell you but I never got it working i tried to contact them the replied to my first message but no help after that. You can try to contact them through e-mail its listed on the website. If you get it working please help me. : (

      Disgruntled User

       
    • Jani Patokallio

      Jani Patokallio - 2002-04-07

      It looks like your Java classpath doesn't include MarsProject.class, which is strange since the BAT file sets the classpath to include the present directory.

      Try this for a workaround: Open up a command prompt, CD to the directory containing MarsProject.class, and run MarsProject.bat there.  Does that help?  If not, can you give the exact error message?

      Cheers,
      -jani

       
      • David

        David - 2002-04-07

        Thanks Ill try that out.

         
      • Heinz König

        Heinz König - 2002-04-08

        Microsoft Windows 2000 [Version 5.00.2195]
        (C) Copyright 1985-2000 Microsoft Corp.
        K:\>e:
        E:\>cd MarsProject
        E:\MarsProject>MarsProject.bat
        E:\MarsProject>javaw MarsProject

        A MsgBox critical pops up with the title:
        "Java Virtual Machine Launcher" and the text
        "Could not find the main class. Program will exit!"

        Trying to start marsproject using "java" causes
        an error (I don't know what "java" actually does
        so might not be important)

        E:\MarsProject>java MarsProject
        Exception in thread "main" java.lang.NoClassDefFoundError: MarsProject

        I'm using JRE2 1.3.0_01

        Regards!

         
    • Heinz König

      Heinz König - 2002-05-20

      found something out that might be interesting:

      Whenever I type in "javaw MarsProject" I get the error message "Could not find the main class. Program will exit!" no matter I do this in the marsproject directory or elsewhere, and no matter if a file called Marsproject even exists.

      HTH

       
    • Scott Davis

      Scott Davis - 2002-05-21

      Have to admit I'm a bit stumped as to why this isn't working.  The local directory should be in the Java classpath by default.

      Here's a long shot.  Try going to the console, changing to the project's directory and type:

      java -classpath . MarsProject

      Let me know if that works or not.

      Scott Davis

       
      • Scott Davis

        Scott Davis - 2002-05-23

        I got a confirmation from a user with this problem and the above fix resolved it.

        Try modifying your MarsProject.bat file to the following:

        java -classpath . MarsProject

        Let me know if this helps.

        Scott Davis
        Mars Simulation Project
        http://mars-sim.sourceforge.net
        scud1@users.sourceforge.net

         
    • Foo Fuu

      Foo Fuu - 2002-05-29

      There is something very odd going on with the script files.

      Running the MarsProject.sh script (after making it executable) produces a no such file error on my RH7.1 system. However, if the script is cat'ed, and that line copied and pasted and run on it's own line, everything works fine. If that line is then echo'd into a new script, or the same script, it will then run fine.

      The same also goes for the make.sh script.

      Are there some strange characters in the script maybe, and this breaks some shells?

      rubberduck9

       
      • Scott Davis

        Scott Davis - 2002-06-05

        I'm not exactly sure why this is.  Perhaps the two scripts were copied over from DOS batch files and just changed to .sh files.  I think DOS has different line breaks in text files which might be the problem on some shells.

        I'll see if I can clean this up for the next version.

        Thanks for the heads up.

        Scott Davis

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.