Results 1 to 6 of 6

Thread: ClassNotFoundException Error in Java

  1. #1
    Join Date
    Jan 2010
    Posts
    79

    ClassNotFoundException Error in Java

    I am trying to compile my Java program but not getting successful compiled. Everytime I am compiling or running my program the ClassNotFoundException Error is popping out. Since, I am newbie to such programs, I am not able to resolve this problem. Also I am nor knowing exactly which method is generating this issue..?! So thought that there would be anyone who must be knowing solution for this.!! Please help me in solving my doubt. I am looking for the proper explanation along with the other information that would be useful for me.

  2. #2
    Join Date
    Mar 2008
    Posts
    227

    Re: ClassNotFoundException Error in Java

    ClassNotFoundException may be raised mainly by three methods:
    • The method forName the Class class.
    • The method of ClassLoader findSystemClass.
    • The loadClass method in class ClassLoader.

    I think that you should look at the above methods and the problem will get solved automatically.

  3. #3
    Join Date
    Mar 2008
    Posts
    232

    Re: ClassNotFoundException Error in Java

    The exception that you are getting may indicate two things:
    • Either your CLASSPATH is misconfigured.
    • Whether the rights of the jar file or class file does not allow reading of it for the current user.

    Check that your external libraries are referenced in the CLASSPATH. To put a library (jar) in the CLASSPATH you can place it in the directory JAVA_HOME / jre / lib / ext. A second possibility is to define the CLASSPATH when launching the command java (-cp).

  4. #4
    Join Date
    Apr 2008
    Posts
    193

    Re: ClassNotFoundException Error in Java

    If you use a jar, you must reference the external libraries in the manifest. I would like to recommend you to use the executable jar. If you are not having the idea of creating the executable jar, then you should look at this tips. If your CLASSPATH is correct, then check the rights of your files, you must have at least read permission.

  5. #5
    Join Date
    Oct 2008
    Posts
    167

    Re: ClassNotFoundException Error in Java

    You should also know about the IndexOutOfBoundsException. Thrown when trying to access a cell of a table that does not exist. It must first check the specified line (in the stacktrace) that does not attempt to access a nonexistent box (X).
    Code:
    int [] monTab = new int [20];  
    for ( int i = 0 ;i < 20 ;i + + ) 
    { 
    tab[i] = i; 
     } 
    System.out. println (tab[20]);
    Most commonly, this error comes from the fact that we try to acedia in the last cell of the table without taking into account the fact that the table starts at index 0 and not as one might think.

  6. #6
    Join Date
    Dec 2008
    Posts
    202

    Re: How to intercept all Throwable an application?

    I would like to discuss about how to intercept all Throwable an application?! In a graphical application exceptions are triggered from the thread dedicated to the display. It is not possible to catch these exceptions with a try / catch classic. It is possible to register a class that will manage its mistakes. For this system property sun.awt.exception.handler must contain the full name of a class with a handle () method. This can be done by passing the "-Dsun.awt.exception.handler =..." the virtual machine or through the method System.setProperty (). At each uncaught exception, a new instance of this class is created (you have an empty constructor) and handle () method is called. This does not work with Java 5.0. As part of Java 5.0 can be used with the method UncaughtExceptionHandler Thread.setDefaultUncaughtExceptionHandler () (see with setUncaughtExceptionHandler () to make the thread by thread ...). This solution is much cleaner, but unfortunately it fell like a JVM 5.0.

Similar Threads

  1. Getting error: "Java Error 1723” on my windows 7 system
    By Cajetan in forum Operating Systems
    Replies: 7
    Last Post: 26-01-2012, 02:39 AM
  2. Replies: 5
    Last Post: 27-08-2011, 10:36 PM
  3. Replies: 5
    Last Post: 15-12-2010, 07:18 PM
  4. Error message: Uncaught Exception java.lang.error
    By Rum in forum Portable Devices
    Replies: 5
    Last Post: 06-01-2010, 01:59 PM
  5. ClassNotFoundException Error in PostgreSQL
    By Nurhan in forum Software Development
    Replies: 3
    Last Post: 06-03-2009, 12:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,274,325.16760 seconds with 17 queries