Results 1 to 3 of 3

Thread: Java problem

  1. #1
    Corroptev is offline Member
    Join Date
    Jan 2012
    Rep Power

    Question Java problem

    Hello, im sorry if bad category, im new here...
    And im new to java too, i have a problem, im trying to solve it all the day, but it always shows this:
    Microsoft Windows [Verze 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. Všechna práva vyhrazena.

    C:\Users\nick\Desktop\Java>java AhojSveteApp
    Exception in thread "main" java.lang.NoClassDefFoundError: AhojSveteApp (wrong n
    ame: ahojsveteapp/AhojSveteApp)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at n Source)
    at Source)
    at$000(Unknown Source)
    at$ Source)
    at Method)
    at Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: AhojSveteApp. Program will exit.
    I edited PATHS, JAVA_HOME, Java path... whats bad, please?

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Richmond, Virginia
    Blog Entries
    Rep Power

    Default Re: Java problem

    Are you trying to run the class from in the directory it is located in? Is that the java directory with the jdk? If so, you shouldn't relly be storing any java files in there.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Java problem

    The class is in a package, You must include the package name with the classname
    AhojSveteApp (wrong name: ahojsveteapp/AhojSveteApp)

    java ahojsveteapp.AhojSveteApp
    and the classpath must point to the folder containing the ahojsveteapp folder.

    Or remove the package statement from the source.

Similar Threads

  1. Replies: 4
    Last Post: 03-16-2012, 11:29 AM
  2. Small problem with problem with Java, C++ parse program.
    By dragstang86 in forum New To Java
    Replies: 4
    Last Post: 10-30-2011, 03:43 AM
  3. Help! Java Problem!!
    By TheBreakdown in forum New To Java
    Replies: 2
    Last Post: 08-04-2011, 09:06 AM
  4. java problem!
    By nini86 in forum New To Java
    Replies: 7
    Last Post: 05-30-2011, 02:42 PM
  5. Problem Display Jmenubar Java Se6 u23 versus Java SE6 u22
    By Ravanelly in forum Advanced Java
    Replies: 0
    Last Post: 01-07-2011, 09:36 AM

Posting Permissions

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