[jsword-devel] How do you use eclipse to run a default ANT task?

Joe Walker jsword-devel@crosswire.org
Fri, 14 Mar 2003 16:18:05 +0000


Stephen Denne wrote:

>I'm new to eclipse too, and I'm using the bleeding edge releases... is
>running ant tasks different with in eclipse 2.0? I'm forever asked which of
>the ant tasks I would like to run, and the only one that works is
>jsword-ant-clean. All the others complain of being unable to find javac.
>...
>compile.section:
>        [echo] Compiling ./java/common
>       [mkdir] Created dir: C:\jsword\target\ant\temp\classes\common
>       [javac] Compiling 96 source files to
>C:\jsword\target\ant\temp\classes\common
>       [javac] BUILD FAILED: file:C:/jsword/build.xml:141: 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: 681 milliseconds
>
Groan.
I hate this problem, a number of people at work have been up against the 
same thing, and the fix rarely seems to be looking at JAVA_HOME as 
indicated. I think the problem is with Eclipse and not JSword.

Here is what I do to get it working on windows (which is the only place 
I've seen the problem).
- Install the latest JDK.
- Set JAVA_HOME to point at the install dir (not the bin dir)
- include %JAVA_HOME%/bin in the PATH
- Close *all* the environment dialogs
- Check that after opening a *new* command shell and typing "java 
-version" yuo get the correct number.
- Ensure there are no java.exe files in c:\windows or 
c:\windows\system32 (or whatever they are called on your system)
- Check in HKEY_LOCAL_MACHINE/Software/JavaSoft/Version# that stuff is 
pointing at the right place and the default key is a sensible version 
number.
- Restart Eclipse and have another go
- Give up and use a batch script instead

Any of the above checks *could* fix it, or maybe none of them will, but 
it is worth a try.

Joe.