Category Archives: Uncategorized

Can’t get maxent to run in R?

I have some R code that calls to maxent. It worked 5 months ago but when i tried to run it recently, the call to maxent wasn’t working anymore. It turns out that something had changed on my computer such that R didn’t know the path to Java. Here’s the fix for windows 7 (for other operating systems for step 2, see http://java.com/en/download/help/path.xml.)

Step 1: find the path to the javaw.exe file on your computer

  1. Start menu > All Programs > Java
  2. in the Java Control Panel: Java tab > View… > User > Path
  3. copy the path to the javaw.exe file e.g. “C:\Program Files (x86)\Java\jre7\bin\”

Step 2: add the path to the Windows path variable

  1. Select Computer from the Start menu
  2. Choose System Properties from the context menu
  3. Click Advanced system settings > Advanced tab
  4. Click on Environment Variables, under System Variables, find path, and click on it.
  5. In the Edit windows, modify path by adding the directory of the javaw.exe file to the value for path. e.g. “…QuickTime\QTSystem\;C:\Program Files (x86)\Java\jre7\bin\”
  6. click ok

Step 3: Restart R or Rstudio to register this change in R.

Good luck!