db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Irum Godil <softwarengineer2...@yahoo.com>
Subject Re: Build Errors (building Derby under Eclipse)
Date Thu, 20 Jan 2005 02:14:41 GMT
Hi, 
 
I was wondering if there is a way to build Derby in Eclipse without using the Ant file altogether.
Has anyone been successful in doing so? I want to add some aspect oriented refactoring, and
I am having a very hard time figuring out how to build derby using the AspectJ compiler with
ANT. If I can build it directly from the Java compiler in Eclipse, my life would become a
lot easier. 
 
thanks.

"Jean T. Anderson" <jta@bristowhill.com> wrote:
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/ReadMsg?listName=derby-user@db.apache.org&msgNo=519
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=derby-user@db.apache.org&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




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
View raw message