Naina Dani | 1 Jul 22:25
Picon

how to set JAVA_HOME in antscript build.xml

Hello everybody,

I am facing a peculiar problem. I have two projects in anthill. One of them needs java 1.4 and the other needs java 1.5. The problem is, if I set JAVA_HOME to 1.4 or 1.5 in my .profile, one project builds and the other fail.

So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME is set depending on the project being built. Can anybody give me an idea how to do this ?

Thanks in advance.
Regards,
Naina.

_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Naina Dani | 1 Jul 22:32
Picon

how to set JAVA_HOME in antscript build.xml


Hello everybody,

I am facing a peculiar problem. I have two projects in anthill. One of them needs java 1.4 and the other needs java 1.5. The problem is, if I set JAVA_HOME to 1.4 or 1.5 in my .profile, one project builds and the other fail.

So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME is set depending on the project being built. Can anybody give me an idea how to do this ?

Thanks in advance.
Regards,
Naina.

_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Eric Minick | 1 Jul 22:39

Re: how to set JAVA_HOME in antscript build.xml

Naina,

Typically we have recommended having two Anthill OS instances standing 
next to each-other. Multiple jre support was always one of those things 
the commercial tool did.

I suppose you could have a stubbed out Ant script that calls your real 
script through the exec task. The exec task does take environment 
variables as options, so that should work. I haven't tried that though.

Cheers,

Eric

Naina Dani wrote:
> Hello everybody,
>
> I am facing a peculiar problem. I have two projects in anthill. One of 
> them needs java 1.4 and the other needs java 1.5. The problem is, if I 
> set JAVA_HOME to 1.4 or 1.5 in my .profile, one project builds and the 
> other fail.
>
> So I want to set JAVA_HOME in build.xml of the project, so that 
> JAVA_HOME is set depending on the project being built. Can anybody 
> give me an idea how to do this ?
>
> Thanks in advance.
> Regards,
> Naina.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Anthill mailing list
> Anthill@...
> http://lists.urbancode.com/mailman/listinfo/anthill
>   
Naina Dani | 1 Jul 22:51
Picon

Re: how to set JAVA_HOME in antscript build.xml

Hello Eric,

Thank you so much for the help.

Here in the current situation, one project is dependent on the other. So having two anthill instances is ruled out.

I do not know how to stub out main ant script calling the real script through the exec task. Could you please elaborate this further.

Thanks again for the help :)

Regards,
Naina.

On Tue, Jul 1, 2008 at 3:39 PM, Eric Minick <etm-SVNIZWSJOcJl57MIdRCFDg@public.gmane.org> wrote:
Naina,

Typically we have recommended having two Anthill OS instances standing next to each-other. Multiple jre support was always one of those things the commercial tool did.

I suppose you could have a stubbed out Ant script that calls your real script through the exec task. The exec task does take environment variables as options, so that should work. I haven't tried that though.

Cheers,

Eric

Naina Dani wrote:
Hello everybody,

I am facing a peculiar problem. I have two projects in anthill. One of them needs java 1.4 and the other needs java 1.5. The problem is, if I set JAVA_HOME to 1.4 or 1.5 in my .profile, one project builds and the other fail.

So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME is set depending on the project being built. Can anybody give me an idea how to do this ?

Thanks in advance.
Regards,
Naina.
------------------------------------------------------------------------

_______________________________________________
Anthill mailing list
Anthill-IWHQxnLZ/P3rXihlmxnZCEEOCMrvLtNR@public.gmane.org
http://lists.urbancode.com/mailman/listinfo/anthill
 
_______________________________________________
Anthill mailing list
Anthill-IWHQxnLZ/P3rXihlmxnZCEEOCMrvLtNR@public.gmane.org
http://lists.urbancode.com/mailman/listinfo/anthill

_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Kenneth Burgener | 1 Jul 23:53

Create Dependency Group - Permission denied

I have several projects that build successfully.  Today I tried to add a 
Dependency Group only to get the following error:

========================================
15:45:58:067 [http-8080-Processor25] ERROR 
com.urbancode.anthill.web.admin.CreateDependencyGroupServlet  - 
Permission denied
java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:850)
        at 
com.urbancode.anthill.DependencyGroup.<init>(DependencyGroup.java:71)
        at 
com.urbancode.anthill.Anthill.createDependencyGroup(Anthill.java:210)
        at 
com.urbancode.anthill.web.admin.CreateDependencyGroupServlet.processRequest(CreateDependencyGroupServlet.java:65)
        at 
com.urbancode.anthill.web.admin.AnthillBaseServlet.processRequest0(AnthillBaseServlet.java:64)
        at 
com.urbancode.anthill.web.admin.AnthillBaseServlet.doGet(AnthillBaseServlet.java:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
        at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)
15:45:58:068 [http-8080-Processor25] ERROR

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[CreateDependencyGroupServlet]

- Servlet.service() for servlet CreateDependencyGroupServlet threw exception
java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:850)
        at 
com.urbancode.anthill.DependencyGroup.<init>(DependencyGroup.java:71)
        at 
com.urbancode.anthill.Anthill.createDependencyGroup(Anthill.java:210)
        at 
com.urbancode.anthill.web.admin.CreateDependencyGroupServlet.processRequest(CreateDependencyGroupServlet.java:65)
        at 
com.urbancode.anthill.web.admin.AnthillBaseServlet.processRequest0(AnthillBaseServlet.java:64)
        at 
com.urbancode.anthill.web.admin.AnthillBaseServlet.doGet(AnthillBaseServlet.java:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
        at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)
========================================

I am running Anthill version 1.8.1.303 with Java 1.5.0_13.  I am running 
Anthill with the user "build", which owns the whole anthill folder (I 
even ran "chown -R build:build /opt/anthill" just to make sure).  I can 
add, build and modify projects successfully.  I can also change the 
Anthill Properties and I can create, delete and update schedules as well.

Has anyone run into this before?

Thanks,
Kenneth
Kenneth Burgener | 2 Jul 00:06

Re: how to set JAVA_HOME in antscript build.xml

On 7/1/2008 2:25 PM, Naina Dani wrote:
> So I want to set JAVA_HOME in build.xml of the project, so that 
> JAVA_HOME is set depending on the project being built. Can anybody give 
> me an idea how to do this ?

We have an old project that had to be built with the 1.4 compiler.  To 
do this we used the "executable" parameter to the javac task.

<javac srcdir="${project.test}"
   destdir="${build.test}"
   source="1.4"
   target="1.4"
   debug="on"
   deprecation="off"
   optimize="on"
   fork="yes"
   executable="${jdk1.4}/bin/javac">
   <classpath>
      ...
   </classpath>
</javac>

This might work for you.

Kenneth
Jim Hague | 2 Jul 11:17
X-Face
Picon
Favicon
Gravatar

Re: how to set JAVA_HOME in antscript build.xml

On Tuesday 01 July 2008 21:51:43 Naina Dani wrote:
> I do not know how to stub out main ant script calling the real script
> through the exec task. Could you please elaborate this further.

We're running Anthill OS under JDK 1.6, and using the JDK 1.6 compiler to 
build a project targetted at the 1.4 JVM. In the relevant build.xml we have:

  <property name="waldo.java.source.version" value="1.4"/>
  <property name="waldo.java.target.version" value="1.4"/>

    <javac destdir="${build}" classpathref="libs.path"
      debug="${debug}" optimize="${optimize}" deprecation="on"
      source="${waldo.java.source.version}"
      target="${waldo.java.target.version}">
      <src refid="src.path"/>
    </javac>

(Waldo is the internal project name).
--

-- 
Jim Hague - jim.hague@...          Never trust a computer you can't lift.
Matt Pangaro | 2 Jul 13:50

Re: how to set JAVA_HOME in antscript build.xml

Note for everyone. Use source and target carefully and test thoroughly. 
We used to do this with the 1.5 compiler, and you would end up with code 
that would not execute on a 1.4 JVM, but you wouldn't find out until 
execution time of that particular code. In this case, 1.5 would build 
some String operations using methods that were @since 1.5. It was 
reported but Sun's official position on it was that there wasn't a bug, 
or that they weren't going to fix it, since there was a workaround (use 
1.4 compiler).

Jim Hague wrote:
> On Tuesday 01 July 2008 21:51:43 Naina Dani wrote:
>> I do not know how to stub out main ant script calling the real script
>> through the exec task. Could you please elaborate this further.
> 
> We're running Anthill OS under JDK 1.6, and using the JDK 1.6 compiler to 
> build a project targetted at the 1.4 JVM. In the relevant build.xml we have:
> 
>   <property name="waldo.java.source.version" value="1.4"/>
>   <property name="waldo.java.target.version" value="1.4"/>
> 
>     <javac destdir="${build}" classpathref="libs.path"
>       debug="${debug}" optimize="${optimize}" deprecation="on"
>       source="${waldo.java.source.version}"
>       target="${waldo.java.target.version}">
>       <src refid="src.path"/>
>     </javac>
> 
> (Waldo is the internal project name).
Naina Dani | 2 Jul 19:00
Picon

Re: how to set JAVA_HOME in antscript build.xml


Hi Kenneth,

Thanks for the help.
The solution you have suggested seems good, but, I have two different environments: Solaris and Windows. So, if I hardcode in the build.xml (  executable="${jdk1.4}/bin/javac">), windows will have a problem compiling the code as it will not find the javac in the hardcoded location. Does anybody has a workaround for this ?

Thanks and Regards,
Naina.


On Tue, Jul 1, 2008 at 5:06 PM, Kenneth Burgener <kenneth-lFTmLTALTN2h2OhbvMiLHw@public.gmane.org> wrote:
On 7/1/2008 2:25 PM, Naina Dani wrote:
So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME is set depending on the project being built. Can anybody give me an idea how to do this ?


We have an old project that had to be built with the 1.4 compiler.  To do this we used the "executable" parameter to the javac task.


<javac srcdir="${project.test}"
 destdir="${build.test}"
 source="1.4"
 target="1.4"
 debug="on"
 deprecation="off"
 optimize="on"
 fork="yes"
 executable="${jdk1.4}/bin/javac">
 <classpath>
    ...
 </classpath>
</javac>


This might work for you.

Kenneth

_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Kenneth Burgener | 2 Jul 19:19

Re: how to set JAVA_HOME in antscript build.xml

On 7/2/2008 11:00 AM, Naina Dani wrote:
> Thanks for the help.
> The solution you have suggested seems good, but, I have two different 
> environments: Solaris and Windows. So, if I hardcode in the build.xml (  
> executable="${jdk1.4}/bin/javac">), windows will have a problem 
> compiling the code as it will not find the javac in the hardcoded 
> location. Does anybody has a workaround for this ?

Will you have two different projects in Anthill, one for Windows and one 
for Solaris?  If so you could just use a property for the whole 
executable parameter:

   executable="${JAVAC}"

and then pass in an overriding parameter from Anthill to have the JAVAC 
point to the appropriate executable.

Kenneth

Gmane