Results 1 to 3 of 3
  1. #1
    rjnagy is offline Member
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Question Third Party Application using Java Prefs and Java Environmental Variables.

    Hello All,
    I have a interesting question and hopefully it is has simple solution. We are getting ready to deploy an application to the Enterprise here. This application requires Java and well the application also uses the HKLM\Software\JavaSoft\Prefs key to store its configuration/preferences. Now I know Java reads things differently than windows so to speak. For Example:

    In the Windows registry if I was going to store a Server name under the Javasoft\Prefs key it would be as follows

    Type=RegSz
    ValueName=ServerName
    Data= /S/E/R/V/E/R-1

    One of the values we are trying to store requires a value that is a filepath. The filepath we would like to use is basically a subfolder under the User's my documents folder so lets call it User1\My Documents\Application1

    So again my understanding is that it would be
    Type=RegSz
    ValueName=App1FilePath
    Data=//C://Users/User1/My /Documents/Application1

    I am able to set this value in a msi/mst. However and here is where my question is I really do not want to hardcode to drive letter. I would prefer to use a Java Environmental Variable that basically would set to the current user without hardcoding drive letter or user with the rest being:

    ??This would be EnvVar?? /My /Documents/Application1/Temp

    Is there a way to do this or am I stuck hardcoding to drive letter and user.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: Third Party Application using Java Prefs and Java Environmental Variables.

    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    farrukh is offline Member
    Join Date
    Aug 2012
    Posts
    13
    Rep Power
    0

    Default Re: Third Party Application using Java Prefs and Java Environmental Variables.

    System.getenv().get("HomeDrive");

Similar Threads

  1. Linux - Reading custom environmental variables
    By colton in forum Advanced Java
    Replies: 0
    Last Post: 10-28-2011, 08:51 PM
  2. Saving prefs
    By DC200 in forum Advanced Java
    Replies: 3
    Last Post: 12-15-2010, 07:25 PM
  3. Replies: 2
    Last Post: 06-26-2010, 09:18 PM
  4. Replies: 2
    Last Post: 05-12-2010, 05:48 PM
  5. Running a third-party-library based application in j2me
    By nishantsuneja in forum CDC and Personal Profile
    Replies: 0
    Last Post: 02-08-2009, 09:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •