2

I was trying to set up NLTK using subprogress to call Stanford corenlp on our server, which is a Gentoo system. But when I try to run it, an error occurs as:

    which: no java.exe in(/home/user/.ENV/bin:/homes/user/bin/.amd64-linux:/homes/user/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.3:/usr/games/bin:.)        

But when I try which java, it shows as /usr/bin/java. But all these work well on my own Ubuntu System.

I am using NERtag by calling the nltk.tag.stanford.NERTagger. All the details of calling java are hidden in that.

Does anyone know how to fix this? Thanks very much!

Cosmozhang
  • 261
  • 1
  • 11
  • 4
    I don't know of a specific solution to your problem, but that `java.exe` there looks suspicious. Are you sure you haven't download a windows package by mistake? – NlightNFotis Jan 12 '15 at 18:29
  • NO. The server is not set up by me. As I said, the same thing is working well on my own Ubuntu. – Cosmozhang Jan 12 '15 at 18:43
  • I agree with NightNFotis that java.exe looks suspicious. Could you include the command you are calling java with? Also, something in here may be relevant: http://stackoverflow.com/questions/7404720/nltk-fails-to-find-the-java-executable – Gabor Angeli Jan 12 '15 at 19:37
  • I am also feeling so suspicious, because Gentoo is a linux system.. – Cosmozhang Jan 12 '15 at 21:02
  • If memory serves, some of the Stanford stuff (coreNLP) uses IKVM, a virtual machine written in .NET, so maybe that is what the NLTK has a dependency on? – michaelok Jan 14 '15 at 16:58
  • I assume that running the thing means running some script. I suggest you run that script through `bash` with the `-x` flag, i.e. `bash -x path/of/script/file`. That should provide more details about what it is doing internally, and why it things the binary should be called `java.exe` as opposed to simply `java`. – MvG Jan 14 '15 at 18:42

0 Answers0