Irum Godil wrote:

 Hi Andrew,

Yes you are right. Eclipse is looking for tools.jar in a different
directory vs. the command line. The program build after I copied tools.jar in the right place.
...



Before everyone forgets this problem, I'd like to attempt to summarize how to build Derby with Eclipse on Windows with information from these messages from Rajesh and Andrew:


http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=519
http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=547

1) Setup everything as per the Derby build doc "How to build Derby" section at http://incubator.apache.org/derby/derby_downloads.html. If you can build Derby from the command line, you're ready to set up Eclipse.

2) Derby uses jdk14 and jdk13 for its builds. So using the default Eclipse building (which uses only one jdk ) may not a good idea.

  un-check the  Preferences for auto building.
  Window - Preferences - Workbench - Build automatically
  Window - Preferences - Run/Debug - Launching - Build (if required)
  before launching

3) The rest of these instructions assume that you checked out the Derby 10.0 codeline in this subdirectory:

  C:\derby10_0\10.0

svn co http://svn.apache.org/repos/asf/incubator/derby/code/branches/10.0/

4) The Eclipse project workspace is pointed to C:\derby10_0, if you try creating a project with the same name '10.0' as above Eclipse identifies the all the required subdirectories including the sources and the classes (will take some time) since the checked out Derby 10.0 has same name.

5) Setup Eclipse to recognize the 'classes' directory as the output folder.

  Right click on the build.xml (most external)  - Run  -  the first 'Ant
  Build' uses the default "buildsource"

  The second  'Ant Build'  gives you the choices of the ant target.

6) The java executable that runs Ant from Eclipse needs to be able to find the JDK tools.jar file -- and it might not be able to find it if Ant is running from a JRE installation.

For the taglet build, Ant tries to pick tools.jar up from the JDK relative to the setting of the Java system property java.home, to avoid having to make a copy of the JDK's tools.jar to another location. On most systems, java.home is set to the *jre* directory of the JDK installation. So, relative to this directory, tools.jar is in ${java.home}/../lib/tools.jar.

However, if Ant is running from a JRE installation instead of a JDK installation, this directory will not exist. If you add the -verbose property to the Ant command line (inside Eclipse) and capture the output, the 4th line of the output will give you the location of the java.home. Once you know the location of java.home, you can copy tools.jar to where the build expects it to be (${java.home}/../lib).


Corrections? Additions? When we have it "right", I'll add a link to the instructions from the Derby FAQ.


thanks!

-jean





Reply via email to