I am recieving the following error even when I run a simple HelloWorld application: Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld I have recently reformatted my HD (Windows 98 OS) and have tried numerous changes the path in the autoexec to point to j2sdk1.4.1_01\bin. Each java program compiles fine, the error only arises when I try to run it. I don't want to hardcode a pointer to my folder where I'll be keeping my java, as I will be using a large number of classes with XML and SOAP. Would it be possible to do this (it's been so long since I had to install Java!!). Below is a copy of my autoexec file. Cheers ps - I've been pointing it to the lib folder aswell and have tried it without %PATH%...nothing seems to work. I don't want to have to enter a load of classpath info into the cmd window as I'll be compiling and running through editors (Windows 98 OS)
@ECHO OFF SET BLASTER=A220 I7 D1 H7 P330 T6 SET SBPCI=C:\SBPCI rem - By Windows Setup - LOADHIGH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:CD1 PROMPT $P$G PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\CDROM;C:\BRCD\COMMAND;C:\BRCD\BI N;C:\j2sdk1.4.1_01\bin;%PATH%
mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi) mode con codepage select=850 keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys
You need to set up you CLASSPATH to at least include the current dir . and some other common directories. Once the CLASSPATH is correctly set up, you will run your Java program successfully.