Skip to content

Installation with Tomcat and Windows

tkuhn edited this page Aug 30, 2011 · 1 revision

The text below was provided by David Rose on 31 January 2011.

This guide presumes that:

  • you are running a Windows OS,
  • your prolog is installed at C:\Program Files\pl
  • your ape.exe is at C:\Attempto\APE\ape.exe
  • your aceeditor_lexicon is at C:\Attempto\ACE\aceeditor_lexicon.pl

If your prolog and ape.exe are somewhere else, then you'll have to adjust accordingly.

Download Tomcat 7.0 from: http://tomcat.apache.org/. Unzip it and put it somewhere convenient, say C:\Tomcat . Edit C:\Tomcat\bin\catalina.bat as follows:

  • Immediately below label :doStart add this line: set CATALINA_OPTS="-Djava.library.path=C:/Program Files/pl/bin/"
  • Of course this presumes that your Prolog is installed in C:\Program Files\pl , as mentioned above.
  • If it's somewhere else, you'll have to set CATALINA_OPTS to point there.

If your WEB-INF\web.xml isn't already setup, then edit it as follows: Change the apecommand parameter:

<context-param>
  <param-name>apecommand</param-name>
    <param-value>C:/Attempto/APE/ape.exe</param-value>
</context-param>

and change the lexicon parameter:

<init-param>
  <param-name>lexicon</param-name>
  <param-value>C:/Attempto/ACE/aceeditor_lexicon.pl</param-value>
</init-param>

Two things to note:

  • Your files may be elsewhere and you'll have to adjust accordingly.
  • Use forward slashes here, not backward; some process wants to encode backslashes with escapes, and things get fouled-up.

Put your attempto.war into C:\Tomcat\webapps. Actually, I don't use a .war; I put a junction to my Eclipse workspace so that changes are transparently adopted. Some people distrust junctions, so they'll want to do this differently.

The easiest way to start and stop your new Tomcat is to open a cmd window at C:\Tomcat\bin and type startup and shutdown. The startup batch file calls catalina.bat, so that's how the -Djava.library.path=C:/Program Files/pl/bin/ gets set.

This should do it for you.

Assuming you're using Eclipse as your IDE, you'll want to install your new Tomcat into Eclipse.

  • Open Window -> Preferences -> Server -> Installed Runtimes or Runtime Environments, depending on Eclipse version.
  • Then click Add... ; that starts a wizard.
  • Select Apache>Apache Tomcat 7.0, and then tell the wizard where Tomcat is located.
  • Now Tomcat 7.0 should be one of your debugging server choices.
  • Next go to menu item Run>Run Configurations... and select the tab (x)=Arguments .
  • In the VM arguments box, add: -Djava.library.path=C:\ProgramFiles\pl\bin\ .
  • Next go to menu item Run>Debug Configurations... and select the tab (x)=Arguments .
  • In the VM arguments box, add: -Djava.library.path=C:\ProgramFiles\pl\bin\ .

Eclipse should work with Tomcat 7.0 now.