cancel
Showing results for 
Search instead for 
Did you mean: 

Can't build sample files

simon
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to install a development environment over here but have some problems while running the Ant build script.

I added all the sample projects and imported the projects in the Eclipse workspace. Afterwards I followed the "link build.xml file" method as descibed in Development Environment. I have the Java JDK 1.5 installed and the compliance level is set to 5.0.

When I right click the build.xml file an choose Ant build I get the following error:
compile-java:
    [mkdir] Created dir: Z:\Winnt\Desktop\Alfresco\projects\core\build\classes
    [javac] Compiling 53 source files to Z:\Winnt\Desktop\Alfresco\projects\core\build\classes

BUILD FAILED
Z:\Winnt\Desktop\Alfresco\common\build.xml:42: The following error occurred while executing this line:
Z:\Winnt\Desktop\Alfresco\common\common.xml:24: Error running javac.exe compiler

Line 24 in common.xml looks like this:

<javac destdir="${dir.classes}" fork="true" deprecation="on" debug="on" target="1.5" source="1.5">

What am I missing here? Any ideas? It seems that Ant is running properly but the Java compiler is complaining, don't know why…
3 REPLIES 3

gavinc
Champ in-the-making
Champ in-the-making
Does the Ant script work if you run it outside of Eclipse?

Is your JAVA_HOME/bin directory in your system PATH environment variable?

simon
Champ in-the-making
Champ in-the-making
Thanks for the reply Gavin.

My JAVA_HOME environment variable is set to the JDK directory. I have not defined the JAVA_HOME/bin variable yet, is this necessary as well?

The Ant script works when I run it outside of Eclipse. I did download a standalone version of Ant to test this because I couldn't find the Ant version Eclipse is using. Is there an integrated Ant version in Eclipse? Could this be the problem?

[Update]
Ah, there are no external JAR files defined in the Eclipse sample projects, could this have something todo with the failing compiling process?

gavinc
Champ in-the-making
Champ in-the-making
Yes, Eclipse does have a built in version of Ant, there's obviously something wrong in the Eclipse environment but I'm not sure what to be honest as I haven't seen the error you are seeing.

You could try running the project-build.xml file in the individual projects just to see if it works that way.

You can also try putting the JDK bin in your systems PATH environment variable and see if that makes a difference.

i.e. set PATH=%PATH%;%JAVA_HOME%\bin

Hope this helps.