title: envirnoment variable set on terminal but System.getenv returns null. java problems
body: <p>I've changed my <code>~/.bashrc</code> file. I've changed <code>/etc/environment</code>. I've done <code>export WNHOME="/usr/local/WordNet-3.0"</code>. I tried everything <a href="https://unix.stackexchange.com/questions/21598/how-do-i-set-a-user-environment-variable-permanently-not-session">here</a> and more. (I'm running arch linux, in case that's of any consequence).</p>
  
  <p>I think the environment variable must be set on my machine, if I check it with <code>echo $WNHOME</code> I get the correct result. </p>
  
  <p>However when I call <code>System.out.println(System.getenv("WNHOME"));</code> in my java program I keep getting <code>null</code>, what could be the reason for this?</p>
  
  <p>The output looks like this: </p>
  
  <pre><code>Path is 'null/dict'
  null
  Exception in thread "main" java.io.IOException: Dictionary directory does not exist: null/dict
  at edu.mit.jwi.data.FileProvider.open(FileProvider.java:306)
  at edu.mit.jwi.DataSourceDictionary.open(DataSourceDictionary.java:92)
  at edu.mit.jwi.CachingDictionary.open(CachingDictionary.java:133)
  at MITJavaWordNetInterface.main(MITJavaWordNetInterface.java:30)
  </code></pre>
  
  <p>The code looks like this:</p>
  
  <pre><code>public static void main(String[] args) throws IOException
  {
      // construct the URL to the Wordnet dictionary directory
      String wnhome = System.getenv("WNHOME");
      String path = wnhome + File.separator + "dict";
      System.out.println("Path is '" + path + "'"); 
  
      URL url = new URL ("file", null , path );
      System.out.println(System.getenv("WNHOME"));
      //final URL url = Paths.get(wnhome, "dict").toUri().toURL();
  
      // construct the dictionary object and open it
      IDictionary dict = new Dictionary ( url ) ;
      dict . open () ;
  
      // look up first sense of the word "dog "
      IIndexWord idxWord = dict . getIndexWord ("dog", POS . NOUN ) ;
      IWordID wordID = idxWord . getWordIDs () . get (0) ;
      IWord word = dict . getWord ( wordID ) ;
      System . out . println ("Id = " + wordID ) ;
      System . out . println (" Lemma = " + word . getLemma () ) ;
      System . out . println (" Gloss = " + word . getSynset () . getGloss () ) ;      
  } 
  </code></pre>