Running a class file under Linux
Hi there!Im new to Java under Red Hat Linux. I have written a small Java program in JEdit.
Saved it as /projects/visionx/Test1.java. I have also compiled it to /projects/visionx/Test1.class
The problem is now that i want to run it. Im using the following shell script to
try to do so:
#!/bin/sh
export JAVA_HOME=/java/j2sdk1.4.0_01
#java home directory
if [ JAVA_HOME="" ]; then
echo "Warning: JAVA_HOME environment variable not set."
export java=java
else
export java="$JAVA_HOME/bin/java"
echo "JAVA_HOME=" $JAVA_HOME
fi
exec $java /projects/visionx/Test1
When i run this script i get the following error:
Exception i thread "main" java.lang.NoClassDefFoundError: projects/visionx/Test1
I have checked that the Test1.class file exists in the specified directory! What can be the problem?
akj
(jeg forstår godt dansk, har bare copy-pasted mit engelske spørgsmål fra www.java.sun.com)
