ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniele Development-ML <daniele....@googlemail.com>
Subject Java Memory Error when invoking programmatically Ant API
Date Sat, 22 Aug 2009 19:05:13 GMT
Hi everybody,
I'm porting the following piece of Java code:

       Project project = new Project();
        Target target = new Target();
        SignJar sj = new SignJar();
        target.addTask(sj);

        project.addTarget("sign_jar", target);

        sj.setKeystore(sigFile);
        sj.setAlias("signalias");

        sj.setKeypass("keypassword");
        sj.setStorepass("keyStorePass");

        sj.setProject(project);
        sj.setVerbose(true);
        sj.setJar(file);

        sj.setMaxmemory("100m");

        project.executeTarget("sign_jar");

>From Windows to Linux, and I'm getting the following exception:

java.io.IOException error code=12 : cannot allocate memory.

The stack trace indicated that the statement raising the exception is
project.executeTarget. From a search in the web I have found out that this
problem can be solved by setting the fork attribute to true, when using the
javac task in the conventional way (i.e. using the build.xml file, and not
invoking the Ant API programmatically).

I'm browsing the API but I can't find a way to set this attribute -
providing it would be valid for the SignJar task.

Any suggestion/help are very much appreciated.

Thanks,

Dan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message