Results 1 to 13 of 13
- 10-15-2010, 07:42 AM #1
Member
- Join Date
- Jul 2010
- Posts
- 14
- Rep Power
- 0
- 10-15-2010, 08:43 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
There is no direct way to find the system folder using Java. However with a proper combination of several system properties it could be done.
- 10-15-2010, 08:44 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
For an example, following statement always return the system drive in windows.
And there are many other ways to do that.Java Code:System.getProperty("user.home").charAt(0)
- 10-15-2010, 10:20 AM #4
Member
- Join Date
- Jul 2010
- Posts
- 14
- Rep Power
- 0
thanks Eranga,
it shows user directory as c. But i want to find the find path where the software is going to installed. for example java will be installed in c:\program files\java.
- 10-15-2010, 10:27 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Do you want to find the specifically any application installed path or the common installation path?
The thing is this, in most of the installation you can define the custom folder paths, like in D: and so on. For example JDK could install in C: drive.
- 10-15-2010, 10:49 AM #6
Member
- Join Date
- Jul 2010
- Posts
- 14
- Rep Power
- 0
i want common installation path..
- 10-15-2010, 12:05 PM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
- 10-18-2010, 10:27 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
In System Properties you cannot find a such. But as I said you can manipulate it in many ways,
- 10-18-2010, 10:29 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-18-2010, 10:35 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Except on my machine which has two.
ProgramFiles and Program Files (x86).
- 10-18-2010, 10:45 AM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes, it's correct. In my PC I've three systems partitions. But the point is, there is only one system drives, unless you don't have Windows installations.
But there is only one user root, in a single OS installation. So that user.home always have one value.
Say I've XP in drive c, it'll returns C:\Document & Settings\Eranga if I'm log into XP. Say Win7 in drive D: then the return is D:\Document & Settings\Eranga
- 10-18-2010, 10:57 AM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Oh yes, user.home is easy.
At least on Windows and *nix-based, not had to use anything else in years.
But "common installation path" is a nonsense, even on Windows.
- 10-18-2010, 11:05 AM #13
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
setting class-path & Library Path in ubantu
By programmer_007 in forum EclipseReplies: 18Last Post: 02-22-2010, 12:31 PM -
the installation assistant have been interrumped before the installation was complete
By frs80 in forum New To JavaReplies: 13Last Post: 01-24-2010, 10:58 AM -
java installation assistant have been interrumped before the installation finished
By frs80 in forum Java SoftwareReplies: 0Last Post: 01-18-2010, 02:57 AM -
Read eclipse installation path in java
By java_kick in forum Advanced JavaReplies: 0Last Post: 03-23-2009, 02:49 PM -
[SOLVED] Access to default session deniedAccess to default session denied
By jazz2k8 in forum NetworkingReplies: 1Last Post: 03-10-2009, 01:12 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks