Results 1 to 9 of 9
  1. #1
    egbert95 is offline Member
    Join Date
    Jul 2010
    Posts
    9
    Rep Power
    0

    Exclamation Could not find main class: Jframe. Program will exit.

    have a huge problem, which i cant solve.

    When i try to open a .bat file, with this code:

    @echo off
    title WE NEED TO BE #1 AGAIN SO PLEASE VOTE!
    javaw -Xmx300m Jframe 10 0 highmem members 32
    exit

    An error pops up and says Could not find main class: Jframe. Program will exit.


    Now, i already checked if maybe Jframe.class was missing, but this wasnt the case.

    it looks like my computer just cant detect this file. I've got windows Vista.

    - PLease help me? (in normal language, i dont understand most of java things)

    Ask anything you want to, i will reply as fast as i can.


    You all might think: "This isn't an advanced question.."
    But so far, ive seen no solutions on the internet, and tried a whole lot of things.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    You could not find anything? Hint: what's the most viewed topic on this forum?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    egbert95 is offline Member
    Join Date
    Jul 2010
    Posts
    9
    Rep Power
    0

    Default

    Well idk, please tell me?

    or send link
    or somthing like that.

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Every beginner tutorial and reply #7:
    Could not find the main class, program will exit.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    egbert95 is offline Member
    Join Date
    Jul 2010
    Posts
    9
    Rep Power
    0

    Exclamation

    Ok i just readed it all,

    but i dont understand anything.
    i mean i dont understand what actually the solution is now, because im not very smart with java.

    Could you explain it to me?

    thanks

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Then read this: http://download.oracle.com/javase/tu...ems/index.html
    And within 9 minutes you certainly didn't read the articles linked in reply #38
    Last edited by PhHein; 07-29-2010 at 12:49 PM.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    egbert95 is offline Member
    Join Date
    Jul 2010
    Posts
    9
    Rep Power
    0

    Default

    Now, i indeed didnt red the articles in #38

    but the article u just linked me, http://download.oracle.com/javase/tu...ems/index.html

    One of the places java tries to find your .class file is your current directory. So if your .class file is in C:\java, you should change your current directory to that.

    Now, my .class file already is in the file with the .cmd file, so i can skip that

    If you still have problems, you might have to change your CLASSPATH variable. To see if this is necessary, try clobbering the classpath with the following command.

    set CLASSPATH=
    Now enter java HelloWorldApp again. If the program works now, you'll have to change your CLASSPATH variable. To set this variable, consult the section in the JDK 6 installation instructions. The CLASSPATH variable is set in the same manner.


    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp/class
    A common mistake made by beginner programmers is to try and run the java launcher on the .class file that was created by the compiler. For example, you'll get this error if you try to run your program with java HelloWorldApp.class instead of java HelloWorldApp. Remember, the argument is the name of the class that you want to use, not the filename.

    Exception in thread "main" java.lang.NoSuchMethodError: main

    The Java VM requires that the class you execute with it have a main method at which to begin execution of your application. discusses the main method in detail.


    uhm, i actually dont understand this. Please help?
    my classpath currently is
    C:\windows\system32;C:\windows;C:windows\system32\ wbem;C:\pro gram files\quicktime\QTsystem\

  8. #8
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Quote Originally Posted by egbert95 View Post
    Now, i indeed didnt red the articles in #38

    but the article u just linked me, http://download.oracle.com/javase/tu...ems/index.html

    One of the places java tries to find your .class file is your current directory. So if your .class file is in C:\java, you should change your current directory to that.

    Now, my .class file already is in the file with the .cmd file, so i can skip that
    No, you can't, as you're not running from the command prompt, but from a bat file, so you need to specify the classpath.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

Similar Threads

  1. Replies: 2
    Last Post: 09-22-2011, 09:48 PM
  2. Replies: 4
    Last Post: 07-29-2010, 02:53 PM
  3. Could not find the main class, program will exit.
    By aryubi in forum New To Java
    Replies: 39
    Last Post: 02-19-2010, 10:02 AM
  4. Could not find the main class. Program will exit.
    By XSROSSITER in forum New To Java
    Replies: 0
    Last Post: 01-30-2010, 04:17 AM
  5. Could not find the main class. Program will exit.
    By Carrier in forum New To Java
    Replies: 1
    Last Post: 04-22-2009, 02:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •