Skip to main content

JAVA Exception in main thread java.lang.NoDefFounderror: net/…/AbstractClock



I have a clock program as AbstractClock.java in C:\Users\Neeraj\Prg folder .





CLASSPATH is specified as C:\Users\Neeraj\Prg





COMPILED javac AbstractClock.java with no errors.





RUN AS java -cp . net.sf.fmj.ejmf.toolkit.media.AbstractClock





Getting errors as





Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/fmj/ejmf/toolkit/media/AbstractClock

Caused by: java.lang.ClassNotFoundException: net/sf/fmj/ejmf/toolkit/media/AbstractClock

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:315)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

Could not find the main class: com.hib.TranslateSQL. Program will exit.





PROGRAM:-







package net.sf.fmj.ejmf.toolkit.media;



import java.lang.*;

import javax.media.Clock;

import javax.media.Time;



import javax.media.TimeBase;



public class AbstractClock implements Clock {



private TimeBase systemtimebase = Manager.getSystemTimeBase();



public AbstractClock() { super(); }



///REST ALL METHODS

}







I am running this in commandprompt in Windows. I have seen other posts and changed classpath and run command, but still error occurs.Please provide steps suitable for running in windows in command prompt to rectify this mistake.


Comments

  1. Is you java file in C:\Users\Neeraj\Prg or is it in C:\Users\Neeraj\Prg\net\sf\fmj\ejmf\toolkit\media\ ?
    Packages in java are related to directories. So your classpath is the top level directory in which packages live. A class with the package name net.sf.fmj.ejmf.toolkit should be in that directory.

    ReplyDelete
  2. Since javax.media package was needed, i installed the same. I think Maybe net.sf.fmj.ejmf.toolkit package is present in javax.media.

    Program files has JAVA and JMF directories.So should i include both in the classpath.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.