facebook

Get the System Environment Variable

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #286539 Reply

    ja
    Member

    Hi
    I have installed ME Version: 6.0.1 GA .I have configured JBOSS 4.0 server to my web project..My project needs to get the system environment variable which is a folder path so i am using System.getProperty(“JBOSS_HOME”). When i start the server from cmd using run command, i m able to get the value for the variable.But when i try to start the server from ME, it gives me a null value..
    Please some body give help
    Thanks in advance

    #286555 Reply

    Loyal Water
    Member

    Firstly, you have to configure the connector to look like this:-
    https://www.genuitec.com/forums/topic/jboss-4-what-does-a-configured-connector-look-like/

    Now after setting up the connector, create a new launch config and enter the environment variable under the Environment tab. This doc will give you more information on how to create the Custom Launch Config:-
    http://www.myeclipseide.com/documentation/quickstarts/appservers/#createcustom

    #286614 Reply

    ja
    Member

    Hi
    I had already done that.When i create a environment variable as JBOSS_HOME, in Arguments tab, under VM arguments there was a value -Djboss.home=D:/JbossMCD . so i tried including the following code
    String JBOSS_HOME = System.getProperty(“JBOSS_HOME”);
    logger.info(“JBOSS_HOME:”+JBOSS_HOME);
    logger.info(” jboss.home:”+System.getProperty(“jboss.home”));

    if(JBOSS_HOME==null)
    JBOSS_HOME = System.getProperty(“jboss.home”);
    Then it worked correctly.
    Can u explain the reason for that??? why doesn it accept JBOSS_HOME and thne convert it to jboss.home????
    Thanks in advance

    #286660 Reply

    Loyal Water
    Member

    I just check with my dev team and it seems like there is an earier way of doing what I have suggested you to do. instead of using the custom launch config you can edit the connector preferences, under JDK and VM Arguments, set:
    -DJBOSS_HOME=D:/JbossMCD

    -D sets system properties, which is what your trying to use.

    #286679 Reply

    ja
    Member

    Hi Nipun
    Thanks for the reply. But the problem is even if i set the VM argument value as -DJBOSS_HOME=D:/JbossMCD, after i close the window and open it again, it will be reconstructed as -Djboss.home=D:/JbossMCD . So when i check for System.getProperty(“JBOSS_HOME”); eclipse is not able to search for JBOSS_HOME while System.getProperty(“jboss.home”) is giving the answer.Can you please tell me if this can be corrected…
    Thanks

    #286682 Reply

    ja
    Member

    Hi Nipun
    Sorry i had not tried adding the value under JDK VM argument. When i tried that its working fine. Thanks a lot.

    #286723 Reply

    Loyal Water
    Member

    Your welcome.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Get the System Environment Variable

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