I have the following code
package myPackage;
import org.neo4j.graphdb;
import org.neo4j.kernel.EmbeddedGraphDatabase;
public class dbServlet extends HttpServlet {
public void init() throws ServletException {
// Start up the database here
GraphDatabaseService graphDb = new EmbeddedGraphDatabase("var/base");
}
public void destroy() {
graphDb.shutdown();
}
and build.xml file:
<project name="dbServlet" basedir="." default="compile">
<property name="src.dir" value="src"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
</target>
</project>
All of the neo4j jars are located in a lib directory where the build.xml file is. The source is located at src/myPackage/dbServlet.java. When I run ant -v, the classpath includes the jars that have the neo4j classes, but javac is saying the packages don't exist. Anyone know why this could be?
Heres a snippet of the errors (I'm concerned with the first one for now, I know that the servlet api's aren't on the path yet):
[javac] /home/shaun/projects/helloAnt/src/myPackage/dbServlet.java:3: package org.neo4j does not exist
[javac] import org.neo4j.graphdb;
[javac] ^
[javac] /home/shaun/projects/helloAnt/src/myPackage/dbServlet.java:6: cannot find symbol
[javac] symbol: class HttpServlet
[javac] public class dbServlet extends HttpServlet {
[javac] ^
[javac] /home/shaun/projects/helloAnt/src/myPackage/dbServlet.java:8: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class myPackage.dbServlet
[javac] public void init() throws ServletException {
[javac] ^