Read file when runing application only having filename and without path

Hi everyone, I am writing a simple program call ReadAP to read a text file. the text file are putting in a same directory with the Class of ReadAP when running

To execute this program, in the DOS mode should input the following command which contain the filename :

java ReadAP text.txt

text.txt is the text file I want to read from this application

The most important things is that, the filename enter in the command line when execute ReadAP should not be include the path (e.g C:\text.txt)

The specification is that the user should not enter the pathname and filename when exceute such as

java ReadAP C:\text.txt> is not allow

It only should enter the filename when excute, and that text file should be exist in the same directory of the class of ReadAP when runningof this project such as java ReadAP text.txt> is allow

It is due to RandomAccessFilem, File, InputStream when create file it should mention the path and the filename,

if I only having the filename, I cannot read the file.

So Is there having any method to get the path of the application runing?

If no, Is it having any another method for doing the above?

Can everyone be help me? Thank you very much attentation

[1269 byte] By [sherman_liu7687a] at [2007-11-26 22:13:52]
# 1
Look into System.getProperty("user.dir"). It provides the current working directory.#
duckbilla at 2007-7-10 11:04:30 > top of Java-index,Java Essentials,Java Programming...
# 2
problem has solved thx very much
sherman_liu7687a at 2007-7-10 11:04:30 > top of Java-index,Java Essentials,Java Programming...