title: Failed to get environment, + java.lang.ExceptionInInitializerError, Traceback IOError: File not found -
body: <p>I run windows 7 on a 64bit system.
  I use netbeans 6.9.1 (the python plug ins are installed)
  Installed also: Python 2.7.1(64), JDK 6 update 24(64), </p>
  
  <p>I'm interested in term extraction so I downloaded montylingua which is supposed to run in Java or/and Python.
  this is the link: <a href="http://web.media.mit.edu/~hugo/montylingua/" rel="nofollow noreferrer">http://web.media.mit.edu/~hugo/montylingua/</a></p>
  
  <p>When I try to run the Sample.java code included in the zip file available, I encounter these problems:</p>
  
  <pre><code>****** MontyLingua v.2.1 ******
  ***** by hugo@media.mit.edu *****
  Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']):
  java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
  
  java.lang.ExceptionInInitializerError
  Caused by: Traceback (innermost last):
    File "C:\work\montylingua-2.0\copy\JMontyLingua.py", line 0, in __init__ 
    File "C:\work\montylingua-2.0\copy\MontyLingua.py", line 0, in __init__ 
    File "C:\work\montylingua-2.0\copy\MontyLemmatiser.py", line 0, in __init__ 
  
  IOError: File not found - 
      at org.python.core.Py.IOError(Py.java)
      at org.python.core.PyFile._setup(PyFile.java)
      at org.python.core.PyFile.&lt;init&gt;(PyFile.java)
      at org.python.core.__builtin__.open(__builtin__.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
      at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
      at org.python.core.PyObject.__call__(PyObject.java)
      at montylingua.MontyLemmatiser$_PyInner.__init__$5(MontyLemmatiser.java:5312)
      at montylingua.MontyLemmatiser$_PyInner.call_function(MontyLemmatiser.java:5219)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyFunction.__call__(PyFunction.java)
      at org.python.core.PyInstance.__init__(PyInstance.java)
      at org.python.core.PyClass.__call__(PyClass.java)
      at org.python.core.PyObject.__call__(PyObject.java)
      at montylingua.MontyLingua$_PyInner.__init__$1(MontyLingua.java:218)
      at montylingua.MontyLingua$_PyInner.call_function(MontyLingua.java:163)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyFunction.__call__(PyFunction.java)
      at org.python.core.PyInstance.__init__(PyInstance.java)
      at org.python.core.PyClass.__call__(PyClass.java)
      at org.python.core.PyObject.__call__(PyObject.java)
      at montylingua.JMontyLingua$_PyInner.__init__$1(JMontyLingua.java:85)
      at montylingua.JMontyLingua$_PyInner.call_function(JMontyLingua.java:63)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyTableCode.call(PyTableCode.java)
      at org.python.core.PyFunction.__call__(PyFunction.java)
      at org.python.core.PyInstance.__init__(PyInstance.java)
      at org.python.core.Py.initProxy(Py.java)
      at montylingua.JMontyLingua.__initProxy__(JMontyLingua.java:256)
      at montylingua.JMontyLingua.&lt;init&gt;(JMontyLingua.java:234)
      at montylinguaapplication.MontySample.&lt;clinit&gt;(MontySample.java:8)
  Could not find the main class: montylinguaapplication.MontySample.  Program will exit.
  Exception in thread "main" Java Result: 1
  BUILD SUCCESSFUL (total time: 3 seconds)
  </code></pre>
  
  <p>I am familiar with Java since I have some small programming experience with it. I know nothing about Python.
  I have set the environment variable "MONTYLINGUA" which is necessary for the program to run. </p>
  
  <p>I have seen a post about Jython from somebody who gets the same first error as me, but I was not able to do anything from the things proposed. (the link of the other post: <a href="https://stackoverflow.com/questions/245787/jython-javaos-getenv-gives-failed-to-get-environment-environ-will-be-empty">Jython - javaos.getenv() gives &quot;Failed to get environment, environ will be empty&quot;</a>)</p>
  
  <p>Anyone who can run this .java file correctly may recommend something.</p>
  
  <p>I can upload the java code also, but I think it is obsolete since it is available and easy to find in the site mentioned...</p>
  
  <p>In the project I included also the JyDT_Update_Site_1.4.15 zip, just in case that this would help, but unfortunately nothing happened.</p>
  
  <p>Maybe I have to add some code in a specific file, like in the case of the other post, but I don't know in which to add what, in my system.</p>
  
  <p>thank you for you time.</p>