Question:
Java error?....... plz help :D?
2008-12-24 02:22:17 UTC
I've been searching for an answer for quite a while now. And nothing seems to work. Many people mentioned things about 'classpath' and 'jar'. I have no clue what to do tho. How do i set the class path? what should i set it as?

Under one solution i read that i go to 'enviroment' and set the class path. Well im there, but i don't got a clue what i set the class path as. so far this is how it looks

Variable name:CLASSPATH
Variable value:C:\Program Files (x86)\Java\jre1.5.0_14\lib\ext\QTJava.zip

Below is my error message
________________________________

Java Plug-in 1.6.0_11
Using JRE version 1.6.0_11 Java HotSpot(TM) Client VM
User home directory = C:\Users\LostG20




----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------

load: class testvmDynamicJavaComPopUp819.class not found.
java.lang.ClassNotFoundException: testvmDynamicJavaComPopUp819.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
load: class loader.class not found.
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.lang.IllegalThreadStateException: forbid thread creation in disposed TG
at sun.plugin.security.ActivatorSecurityManager.checkAccess(Unknown Source)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.(Unknown Source)
at java.awt.EventDispatchThread.(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.EventQueue.initDispatchThread(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
load: class loader.class not found.
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
load: class loader.class not found.
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
load: class loader.class not found.
java.lang.ClassNotFoundException: loader.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unkno
Three answers:
Neeraj Yadav♄
2008-12-24 05:20:51 UTC
The class path tells SDK/JDK/JRE tools and applications where to find third-party and user-defined classes -- that is, classes that are not Java extensions or part of the Java platform. The class path needs to find any classes you've compiled with the javac compiler -- its default is the current directory to conveniently enable those classes to be found.



Solutions:

Through enviroment variable

Create new variable

JAVA_HOME='' Your Java Location"

PATH=%JAVA_HOME%\bin Upto binary

CLASSPATH=%JAVA_HOME%\lib where you have JARs related to java



and yes when you run cmd>java it will look for your compiled classes so better append that classpath with your current .class file location like this...%JAVA_HOME%\lib;Your .class location





2) Through command prompt (but this will exist as long as you have that cmd window opened)



C:> set CLASSPATH=classpath1;classpath2...



where claspath1 is "Java_home\lib" or "Java_home\class" as mentioned in 1st solution.



Now run

cmd>java it will go up this time.





Hope this solves your issues

Cheers:)
zona
2016-06-03 16:27:33 UTC
You can NOT use a method() until you throw an Object onto the heap. You make an Object with the java keyword 'new'. In the desktop app, you should have: Pitch pitch = new Pitch(); // legal, you have no constructor, therefore java creates on-the-fly the default constructor w/o any args now, you have method() int x = pitch.getPitch(major, input); // with the arrays already loaded before this call. that is: if getPitch( int[], int[]); is the signature, you pass the label or two single values with getPitch( a[x], b[x])
Fudge
2008-12-24 03:05:55 UTC
Class path is the path on ur computer where Java searches for .class files .Assume , you've been given a class called foo.class and u want to use it in a new Java program . First store that class in ur hard drive ; assume u stored foo.class at c:\docs\javaFiles\foo.class .Ok? So now u want to use this foo.class in a new program , so u must tell this new program where foo.class exists , which is in c:\docs\javaFiles\foo.

The command is :

My computer -> Right click and select 'Properties' -> Click the tab called 'Advanced = > (at the bottom of the window, u will find 'Environment Variables ' so click it ) - > Search for a variable called 'classpath ' and edit it adding this :



;c:\docs\javaFiles\foo; . ;

Notice there is a dot '.' at the end



Check this :

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...