how to get the current path

H

Happy Day

Hi
I want to get the current working path. I used method
"System.getProperty("user.dir").", but it showed only part of full
path.
How can I find full path?
 
B

bablospresente

Happy said:
Hi
I want to get the current working path. I used method
"System.getProperty("user.dir").", but it showed only part of full
path.
How can I find full path?

it works fine on my wndows

ie. a.java

public class a{
public static String path(){
String p=System.getproperty("user.dir");
}
//call in main
println(pathdir());
}

outpur : C:\Documents and Settings\username\desktop
 
L

Lars Borup Jensen

Happy said:
Hi
I want to get the current working path. I used method
"System.getProperty("user.dir").", but it showed only part of full
path.
How can I find full path?

Or you may want to use a File such as:

new File(System.getProperty("user.dir")).getAbsolutePath()

Regards / Lars Borup Jensen
http://www.it-arbejde.dk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top