Hi everyone,
I keep getting the following 3 errors:
1)When I try to run my class "MainScreen.java" which is a GUI:
C:\Proj\code>java project_gui\MainFrame
Exception in thread "main" java.lang.NoClassDefFoundError: project_gui\MainFrame
(wrong name: project_gui/MainFrame)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
2)When I try to compile another class I am told that a certain line make reference to a deprecated part of the Java library. The Java code it is referring to is:
"DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());"
I have been searching all over the Java API and the net, but still cannot find out what this line should be changed to.
3)Lastly, I am also told that "String(byte[], int)" has been deprecated, but again I cannot find a suitbale replacement.
Please, please can somebody help, as I am at my wits end!!!
Many thanks!
-
PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!! (3 messages)
- Posted by: Michael Simpson
- Posted on: February 10 2005 17:53 EST
Threaded Messages (3)
- PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!! by Colin Yates on February 11 2005 06:13 EST
- PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!! by Richard Rodger on February 11 2005 07:41 EST
- PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!! by Colin Yates on February 12 2005 06:27 EST
- PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!! by Richard Rodger on February 11 2005 07:41 EST
-
PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!![ Go to top ]
- Posted by: Colin Yates
- Posted on: February 11 2005 06:13 EST
- in response to Michael Simpson
What does the class package look like? It should be:
package project_gui;
Also, the public class needs to be the same name as the filename, so either MainFrame needs to be in MainFrame.java, or you need to run java project_gui\MainScreen. -
PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!![ Go to top ]
- Posted by: Richard Rodger
- Posted on: February 11 2005 07:41 EST
- in response to Colin Yates
With the above package definition, try:
java -cp "C:\Proj\code" project_gui.MainFrame -
PLEASE HELP: NASTY COMPILE & RUN TIME ERRORS!!![ Go to top ]
- Posted by: Colin Yates
- Posted on: February 12 2005 06:27 EST
- in response to Richard Rodger
That won't work if the only source file is MainScreen.java will it?
I thought the JVM will only look for "public static void main(String args[]) {}" in the primary class, i.e. MainScreen?
Col