Hi Steinar,

>From your information I am making the following assumption.
You are using the default jde-ant-invocation-method, which is script.

The idea with the script method is that you have setup ANT previously in your
system, i.e you can run it from a shell or command prompt. Then jde-ant in
emacs works seemlessly. The reason I mention this is that ANT installation
requires ANT_HOME and JAVA_HOME to be set.

Now to your question. I could change the jde-ant code to set the JAVA_HOME
environment to the current jde-jdk-registry setting. I don't think this is
the correctly place to do it. My suggestion would be to set the JAVA_HOME 
variable as part of the jde-jdk-registry. And that would fix the problem.

Paul: If I recall correctly I suggested this before. It seems to me like
the correct thing to do but I don't know if users will like jde mocking 
with their environment variables. Any thougths?

Javier

Steinar Bang <[EMAIL PROTECTED]> writes:

> Platform: Intel PII, debian sarge testing/unstable
>         Blackdown j2sdk 1.4.0.99beta-1,
>         ant 1.5.4-3,
>         jde 2.3.2-3,
>         emacs20 20.7-13.1
>
> Java compilation fails in ant, unless I've set the JAVA_HOME in the
> environment before starting emacs.  Is there a way to make it pick up
> the classpath to the current JDK in the jde-jdk-registry setting?
>
> From looking at the jde-ant.el source, I thought setting
> jde-ant-use-global-classpath to t would help, but it didn't.
>
> Any hints and tips appreciated!
>
> Thanx!
>
>
> - Steinar
>
> --8<-- Details follows --8<---
>
> This is the customized jde-jdk-registry setting from ~/.emacs:
>
>  '(jde-jdk-registry (quote (("1.4.0.99beta-1" . "/usr/lib/j2se/1.4")))))
>
>
> This is the prj.el file for the project:
>
> (jde-project-file-version "1.0")
> (jde-set-variables
>  '(jde-ant-enable-find t)
>  '(jde-build-function (quote (jde-ant-build)))
>  '(jde-ant-use-global-classpath t))
>
>
> This is the output from ant:
>
> cd /home/sb/cvs/webapps/shoppe/src/model/
> ant -Dant.home= -buildfile "/home/sb/cvs/webapps/shoppe/build.xml" -emacs  
> Buildfile: /home/sb/cvs/webapps/shoppe/build.xml
>
> prepare:
>
> compile:
> Compiling 1 source file to 
> /home/sb/cvs/webapps/shoppe/${home}/webapps/shoppe/WEB-INF/classes
>
> BUILD FAILED
> file:/home/sb/cvs/webapps/shoppe/build.xml:77: Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK
>
> Total time: 16 seconds
>
> Compilation exited abnormally with code 1 at Wed Dec 31 14:22:28
>
>

-- 
 

Reply via email to