DevOnWindows - shark8me/lenskit GitHub Wiki

Developing on Windows

Getting Windows set up to do LensKit development requires a few things:

  • A JDK (a real JDK, not just a JRE); you can download this from Oracle.
  • Maven (included with Eclipse; to run from the command line, or to run LensKit's integration tests, you will need a standalone Maven from Apache).
  • An IDE, such as Eclipse (see Using Eclipse), NetBeans, or IntelliJ IDEA. You can also use a text editor and command-line tools if you wish.
  • To run all of LensKit's included tests, or to make full use of the code generated by the archetypes:
    • R (from the R Project) with the ggplot2 package installed.
    • A TeX distribution (such as MiKTeX or TeXLive) to run the integration tests or sample LaTeX document included in projects generated by the fancy archetype.
  • The HOME environment variable in your user account set to something reasonable (on Windows 7, C:\Users\<user> is a good choice). See the section on R below for why this is needed.

Setting up Maven

Since the R installer does not put its bin directory on your PATH by default, you either need to add it to your path or configure Maven to know where to find it. You can do this with the following file in C:\Users\<user>\.m2\settings.xml (on Windows 7; the path will be different on Windows XP and likely Vista):

<settings xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                              http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>local-setup</id>
      <properties>
        <rscript.executable>C:\Program Files\R\R-3.0.1\bin\Rscript.exe</rscript.executable>
      </properties>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>local-setup</activeProfile>
  </activeProfiles>
</settings>

You can, of course, set other properties as well, such as [[grouplens.mldata.acknowledge|ML100K]].

R and Environment

On Windows 7 (and possibly other versions), if you do not have a HOME environment variable set, R and Java will pick different defaults. This is a problem for the integration tests, because Java will set a HOME that R will then pick up. So if you launch the R GUI and install ggplot2, it may be installed in a location that R will not look in when it is run via Maven. One solution to this seems to be explicitly setting the HOME variable in your user environment variables.

Once this is done, you can install ggplot2: launch the R GUI and run the command

install.packages("ggplot2")
⚠️ **GitHub.com Fallback** ⚠️