Exception in thread "main" java.lang

1. I have compiled Applications and Applets before with success

and am now getting the following error message:

C:\>java GuessRandNumberAV.java

Exception in thread "main" java.lang.NoClassDefFoundError: GuessRandNumberAV/ja

a

C:\>

2. I am using WINDOWS 95

3. This is my autoexec.bat

C:\PROGRA~1\MCAFEE\VIRUSS~1\SCANPM.EXE C:\

@IF ERRORLEVEL 1 PAUSE

@ECHO OFF

@IF ERRORLEVEL 1 PAUSE

SET SOUND=C:\PROGRA~1\CREATIVE\CTSND

SET MIDI=SYNTH:1 MAP:E MODE:0

SET BLASTER=A220 I5 D1 H5 P330 E620 T6

@ECHO OFF

CLS

PROMPT $P$G

PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\

SET DIRCMD=/O

SET TEMP=C:\WINDOWS\TEMP

REM (by-NETMOUSE-Install) LH MOUSE

rem - By Windows Setup - LH C:\WINDOWS\COMMAND\MSCDEX /D:MSCD001 /M:8

SET PATH=%PATH%;C:\GNET95\DOS

set path=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PCOBWIN;%path%

rem set COBDIR=C:\PCOBWIN;

rem set COBDIR=C:\Program Files\PCOBWIN;

set COBDIR=C:\PCOBWIN;

rem set COBCPY=C:\PCOBWIN\CLASSLIB

rem set COBCPY=C:\Program Files\PCOBWIN\CLASSLIB

set COBCPY=C:\PCOBWIN\CLASSLIB

rem set COBHNF=C:\PCOBWIN

rem set COBHNF=C:\Program Files\PCOBWIN

set COBHNF=C:\PCOBWIN

rem set DSGDIR=C:\PCOBWIN

rem set DSGDIR=C:\Program Files\PCOBWIN

set DSGDIR=C:\PCOBWIN

set COBSW=+P3/S14000

set path=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ProgramFiles\PCOBWIN;%path%

set path=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PCOBWIN;%path%

path c:\windows;c:\windows\command;c:\jdk1.2.2\bin

SET CLASSPATH=C:\JDK1.2.2\LIB\Classes.zip;%CLASSPATH%;.;

4. This is my Explorer

C:

java

jdk1.2

jdk1.2.1

docs

api

guide

images

relnotes

tooldocs

jdk1.2.2

bin

demo

docs

include

include-old

jre

lib

5. Any suggestions?

Thank you.

[2005 byte] By [avalente1] at [2007-9-26 7:35:51]
# 1
This is not the appropriate forum for this question, but here is quick response see if this helps.'javac' is for compiling. [e.g. javac XYZ.java --> need extension]'java' is for starting the JVM. [e.g. java XYZ --> no extension, just the class name]
ashutosh at 2007-7-1 17:36:34 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 2
probably the guy/girl made a typo here. I'm sure he meant to type javac. Quick solution for your problem is to check your classpath and check wether the unfound file is there, otherwise place it there.
pdbc at 2007-7-1 17:36:34 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 3

>Exception in thread "main" java.lang.NoClassDefFoundError: GuessRandNumberAV/ja

a

Looking at the exception, it appears as though he/she really used java to compile. java.exe is looking for a class "java" in a package(directory) "GuessRandNumberAV", hence the class not found error.

ashutosh at 2007-7-1 17:36:34 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 4

The problem may be due to classpath.

try this..

compile your class like

C:\>javac GuessRandNumberAV.java

I assume your class is in C diectory

then if compiled successfully...try to run using

C:\>java GuessRandNumberAV

if this gives the above error and you are sure that your class file is in the same directory from where u are running it then use the following method to run it.

C:\>java -cp . GuessRandNumberAV

I hope this should work

vinod

vinod_kmr at 2007-7-1 17:36:34 > top of Java-index,Other Topics,Java Community Process (JCP) Program...