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
- Start menu > All Programs > Java
- in the Java Control Panel: Java tab > View… > User > Path
- 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
- Select Computer from the Start menu
- Choose System Properties from the context menu
- Click Advanced system settings > Advanced tab
- Click on Environment Variables, under System Variables, find path, and click on it.
- 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\”
- click ok
Step 3: Restart R or Rstudio to register this change in R.
Good luck!