facebook

passing environment variables to MyEclipse 9.1

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #320799 Reply

    I need to pass a couple environment variables from Suse Linux 11 to MyEclipse, so that ${ENV[envvarname]} will be substituted in properties. This works when I run MyEclipse in Windows–but not from Linux.

    I have added the following lines to the myeclipse.ini file:

    -DTOMCAT_SERVER=”$TOMCAT_SERVER”
    -DCIS_ENV=”$CIS_ENV”

    where $TOMCAT_SERVER and $CIS_ENV are bash variables. (I can echo $TOMCAT_SERVER in bash and see the string that I want.)

    There is no substitution into properties, and if I attempt to retrieve these environment variables in my application:

    String tomcat_server = System.getProperty(“TOMCAT_SERVER”);
    String cis_env = System.getProperty(“CIS_ENV”);

    they come back null. What am I missing here?

    UPDATE: I can get the environment variables if I call System.getenv instead–but this does not substitute the environment variables into properties, as it does on Windows. There has to be something different, yet I am running Java 1.5.0_04 on both Windows and Linux.

    #320808 Reply

    support-tony
    Keymaster

    Clayton,

    I couldn’t get this to work in Windows. Did you add something like the following to the myeclipse.ini file in Windows:

    -DTOMCAT_SERVER="%TOMCAT_SERVER%"
    -DCIS_ENV="%CIS_ENV%"

    I tried it with and without quotes but neither worked. I’d be a little surprised if it did work as variable substitution is part of the batch processor in Windows or part of the shell in Linux. However, executing myeclipse from the command line or from a batch file or shell script would work. In Windows, this might be something like:

    myeclipse.exe -vmargs -DCIS_ENV="%CIS_ENV%" -Xmx512m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m

    Please let us know how this works for you.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: passing environment variables to MyEclipse 9.1

You must be logged in to post in the forum log in