Class not found, Jdk1.4 matters?

Why drivers can't be loaded for this machine? Make me strugge for many hours already.

1)

Version j2sdk-1_4_2_07- (Java 2 se, 1.4)

Environment: Windows XP

I keep receiving "Class not found" exception error when running the following simple piece of codes for testing. (No complint When compiling). The code simply reads:

try {

System.out.println("driver loading test step 0 !!!....");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

System.out.println("driver loaded 1 !!!....");

System.exit(0);

}

catch (ClassNotFoundException ee) {

System.out.println("Clss not found\n" + ee.getMessage());

}

My other simple java codes got compiled and run ok in the same enironment.

2)

I then replaced the sun jdcd-odbc bridge driver in the test with a jdbc driver (for Sql server) downloaded from DataDirect.

That is: by replacing the one line above with the following. But it gives me classNot found Exception too. I don't think it has to do with classpath as I add it in the java command line already

Class.forName("com.ddtek.jdbc.sqlserver.SQLServerDriver");

3) I moved the codes to run in my old PC (Windows NT 4) with jdk1.3, the codes are compiled and run WITHOUT Class not found Exception.

I had more than a year experience in developing Java codes (though not recently) but what I experience now is so wierd to me. What's wrong with jdk1.4 or what's wrong with this XP machine?

Thanks.

[1520 byte] By [ykfca] at [2007-10-2 17:09:55]
# 1

99.999% of the time, something is wrong with your classpath at execution time, or with the classname you put in your code (those class names do look right though). That the same code works on another machine almost certainly means that something has set the classpath in the environment on one machine and not the other.

.001 percent of the time, something is wrong with your machine, such as a corrupted file system or OS. If so, reformat your drive, and reinstall everything. However, always, there will be other symptoms of problems (mystery crashes, disappearing files, etc.), so don't waste your time doing this unless your computer is already flaky.

Most likely, you just don't know how to set the classpath for execution. For that, use Google.

StuDerbya at 2007-7-13 18:24:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
After re-installing jdk1.4, jdbc-odbc bridge driver can now be loaded without a problem. No more claas not found exception with this.I am still checking why the jdbc driver (for Sql server) couldn't be loaded when calling for the one from dataDirect.
ykfca at 2007-7-13 18:24:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...