Results 1 to 3 of 3

Thread: Java problem

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

    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 java.security.SecureClassLoader.defineClass(Unknow n Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown 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
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    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 offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    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
  •