Hi, I'm trying to find a file by setting the classpath. The code I'm using is: File currentDir = new File("prop.ini")); and setting the classpath in the autoexec.bat file by adding the directory where the file resides: set classpath=....(previous stuff);c:\temp;. Unfortunately, it's not working. Can anyone enlighten me? Thanks. Yoo-Jin.
If I'm understanding you correctly, you are trying to open/use a file in a Java program that resides in C:\Temp called prop.ini. The classpath will not help you in this, it just tells the java utilities(such as java.exe and javac.exe) where to look for files, not you programs. You may want to use the getCodeBase() method(not exactly sure what class it's in) and then add the rest of the path to the file.
What's brown and sticky? ... a stick. Or a tiny ad.
ScroogeXHTML - small and flexible RTF to HTML converter library