July 21st, 2003, 06:38 AM
Looking for the application path
Hello. How do I search for the application pathname? like the AppPath in visual basic, is there a way in Java to find the application path?
July 21st, 2003, 03:18 PM
I'm not too sure what you are asking for but in java there are 2 paths you need to be aware of.
1. The PATH variable so that you can run java.exe (win32) or java (linux) without specifing the full path.
i.e java MyClass instead of /usr/local/bin/java
2. The CLASSPATH variable is the location of any and all class, zip, properties and jar files that are to be used in your classes or any code that your classes reference.
Both of these are environment variables and can be inspected by viewing them in the command line...
July 21st, 2003, 09:03 PM
Thanks for your reply, but is there's a method or function to find the application path or the current directory?
July 21st, 2003, 09:58 PM
Give this a try...
String homeDir = System.getProperty("java.home");
String classpath = System.getProperty("java.class.path");
I got this info here...
Hope this helps.
July 23rd, 2003, 11:25 AM
Thanks a lot for your help