Skip to main content



      Home
Home » Language IDEs » AspectJ » Setting the exact build environment
Setting the exact build environment [message #15174] Thu, 09 January 2003 11:02 Go to next message
Eclipse UserFriend
Hi

I have a large project that compiles in the shell with exactly this setup

ajc -bootclasspath
c:\Java\j2sdkee1.3.1\lib\j2ee.jar;c:\JavaCVSDepot\GTS\jre\li b\rt.jar;
-extdirs
C:\JavaCVSDepot\GTS\jre\lib\ext;c:\JavaCVSDepot\GTS\client\j ars\computas
-classpath c:\java\aspectj1.0\lib\aspectjrt.jar -lenient
@AllClasses.lst

I am however not able to build it from ajbrowser or Eclipse (2.0 with
org.aspectj.ajde_1.0.6 and org.eclipse.ajdt.ui_0.5.2). Have tweeked the
build settings till my face turns blue. Tried setting the classpath, the
bootclasspath and extdirs (both of the latter using 'Non-standard compiler
options'). No such luck.

My problem is then that I simply cannot control the actual build settings
from within the GUI. This means that I cannot get my hands on the aspect
browsing functionality for this project.

Is there some inherent shortcoming in the current implementation I am
rubbing my nose against or can somebody show me how I can invoke exactly
this build statement from the GUI (short of hardcoding my build statement in
the ajbrowser/AJDT source and building it first :-)? It should be easy,
shouldn't it :-?


Martin Moe Senior Knowledge Engineer
mm@computas.com
http://www.computas.com
Re: Setting the exact build environment [message #15207 is a reply to message #15174] Fri, 10 January 2003 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Well I had to change the code didn't I. If I'm not careful I'll end up
spending my spare time as a contributor to the AspectJ/AJDT rather than
using it in my professional time making both money and fame :-)

So here's what I did:

public String getBootClasspath() {
return null;
}

became

public String getBootClasspath() {
return
preferencesAdapter.getProjectPreference("build.bootclasspath ");
}

with the appropriate edit of $HOME/.ajcbrowser, i.e.:

build.bootclasspath=c\:\\Java\\j2sdkee1.3.1\\lib\\j2ee.jar;c \:\\JavaCVSDepot
\\GTS\\jre\\lib\\rt.jar;

Simple but did the trick for ajbrowser in my case. Hopefully the next
release of AJDT/ajbrowser has support for setting the bootclasspath.

If somebody could supply me with some links/hints on how to set up an
Eclipse project to patch this locally I would appreciate it (have the source
and tried to set up a project myself but there are a lot of dependancies
:-). The benefit might be that I might actually be able to contribute in the
future :-)

My immediate concern is of course to patch the AJDT 0.5.2 release as this
works for me in all other respects (didn't get the 0.6.0b to work).

So, a quick-start for new/possible contributors please?

Martin Moe Senior Knowledge Engineer
mm@computas.com
http://www.computas.com


"Martin Moe" <mm@computas.com> wrote in message
news:avk5k1$g9k$1@rogue.oti.com...
> Hi
>
> I have a large project that compiles in the shell with exactly this setup
>
> ajc -bootclasspath
> c:\Java\j2sdkee1.3.1\lib\j2ee.jar;c:\JavaCVSDepot\GTS\jre\li b\rt.jar;
> -extdirs
> C:\JavaCVSDepot\GTS\jre\lib\ext;c:\JavaCVSDepot\GTS\client\j ars\computas
> -classpath c:\java\aspectj1.0\lib\aspectjrt.jar -lenient
> @AllClasses.lst
>
> I am however not able to build it from ajbrowser or Eclipse (2.0 with
> org.aspectj.ajde_1.0.6 and org.eclipse.ajdt.ui_0.5.2). Have tweeked the
> build settings till my face turns blue. Tried setting the classpath, the
> bootclasspath and extdirs (both of the latter using 'Non-standard compiler
> options'). No such luck.
>
> My problem is then that I simply cannot control the actual build settings
> from within the GUI. This means that I cannot get my hands on the aspect
> browsing functionality for this project.
>
> Is there some inherent shortcoming in the current implementation I am
> rubbing my nose against or can somebody show me how I can invoke exactly
> this build statement from the GUI (short of hardcoding my build statement
in
> the ajbrowser/AJDT source and building it first :-)? It should be easy,
> shouldn't it :-?
>
>
> Martin Moe Senior Knowledge Engineer
> mm@computas.com
> http://www.computas.com
>
>
Re: Setting the exact build environment [message #15240 is a reply to message #15207] Fri, 10 January 2003 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adrian_colyer.uk.ibm.com

Hi Martin,
Obviously I can't reproduce your exact build environment, but here's how I
believe you can configure Eclipse to do what you want when using AJDT (this
actually uses simply the features of the Eclipse JDT that AJDT inherits):

First off for compiling...
Having created your AspectJ project, use the context menu to select the
project properties, and then select Java Build Path. Go to the libraries
tab and use "Add External Jars..." to add in the additional Jar files you
need for compilation.

THEN... go to the "Order and Export" tab and move your newly added jar
files
up in order so that they are ahead of (e.g.) rt.jar - if your project
requires this - it may be that you can omit this step.

That should now enable you to build your project. Incidentally, there's a
view in AJDT (Window->Show View->Other->AspectJ->AJDT Event Trace) that
displays diagnostic information as AJDT executes. One of the pieces of
information you'll find in that view is the exact classpath that AJDT uses
to perform a compile - can come in very handy for problem solving!!

Then, for running the compiled program:
Eclipse uses "launchers" that hold runtime configuration information for
launching applications. Because AspectJ creates plain Java class files,
AJDT
simply uses the normal Java launcher, unchanged. Choose "Run..." from the
run menu / icon, and then select "Java Application" and click "New."
Give your new configuration a name, and then click on the "Classpath" tab.
Now you need to deselect the "Use default classpath" option at the bottom
of
the page. Select the jar files in the "User classes" tab that you actually
want to run from the bootclasspath and click "Remove." The select the
"Bootstrap classes" tab and add the bootclasspath jars back in using the
"Add External Jars..." button.

Phew!! That should do it. Your launch configuration is saved so that you
only have to go through all that hassle the once.

I'd be curious to know if this works for you, and also if anyone knows a
simpler way of setting up Java/AspectJ projects in Eclipse to do this?

Of course, we'd be delighted to have you contribute to the AJDT project
too :-). I'll post instructions on how to set-up an Eclipse environment to
do that under a separate thread.

-- Adrian.
Re: Setting the exact build environment [message #15271 is a reply to message #15240] Tue, 14 January 2003 07:35 Go to previous message
Eclipse UserFriend
Hi Adrian

Meanwhile I did a local patch (i chacked (i.e. checked out and hacked :-)
the 0.5.2 release from CVS) with the same trick I described earlier in the
thread, hacking the
ProjectPropertiesAdapter.getBootClasspath

implementation in
org.eclipse.ajdt.internal.ui.ajde.ProjectProperties.

to suit my particular needs. Now, I am not quite sure why I need to have
these two jars in AJDE's bootclasspath rather than the regular classpath. I
just tweeked the ajc command till it worked and that turned out to be the
significant setting.

Ok, so right now I have to launch a run-time workbench with my chacked patch
of AJDT 0.5.2 and build my project using this workbench. Quite cumbersome
since this is a large project (624 class files). So large in fact that I had
to give -Xmx384m to the VM. you can imagine how my poor little portable
starts to sweat :-) My sanity hangs by a thread of 512M of hard memory taped
with a fair bit of patience.

I have no particular problems launching the project once I manage to build
it. Strange isn't it :-)

Anyway, I am looking forward to the new thread you promised.

Martin

"Adrian Colyer" <adrian_colyer@uk.ibm.com> wrote in message
news:avn7op$gtp$1@rogue.oti.com...
> Hi Martin,
> Obviously I can't reproduce your exact build environment, but here's how I
> believe you can configure Eclipse to do what you want when using AJDT
(this
> actually uses simply the features of the Eclipse JDT that AJDT inherits):
>
> First off for compiling...
> Having created your AspectJ project, use the context menu to select the
> project properties, and then select Java Build Path. Go to the libraries
> tab and use "Add External Jars..." to add in the additional Jar files you
> need for compilation.
>
> THEN... go to the "Order and Export" tab and move your newly added jar
> files
> up in order so that they are ahead of (e.g.) rt.jar - if your project
> requires this - it may be that you can omit this step.
>
> That should now enable you to build your project. Incidentally, there's a
> view in AJDT (Window->Show View->Other->AspectJ->AJDT Event Trace) that
> displays diagnostic information as AJDT executes. One of the pieces of
> information you'll find in that view is the exact classpath that AJDT uses
> to perform a compile - can come in very handy for problem solving!!
>
> Then, for running the compiled program:

<...snip...>

>
> I'd be curious to know if this works for you, and also if anyone knows a
> simpler way of setting up Java/AspectJ projects in Eclipse to do this?

See above.

>
> Of course, we'd be delighted to have you contribute to the AJDT project
> too :-). I'll post instructions on how to set-up an Eclipse environment to
> do that under a separate thread.
>
> -- Adrian.
>
>
Re: Setting the exact build environment [message #563917 is a reply to message #15174] Fri, 10 January 2003 07:51 Go to previous message
Eclipse UserFriend
Well I had to change the code didn't I. If I'm not careful I'll end up
spending my spare time as a contributor to the AspectJ/AJDT rather than
using it in my professional time making both money and fame :-)

So here's what I did:

public String getBootClasspath() {
return null;
}

became

public String getBootClasspath() {
return
preferencesAdapter.getProjectPreference("build.bootclasspath ");
}

with the appropriate edit of $HOME/.ajcbrowser, i.e.:

build.bootclasspath=c\:\\Java\\j2sdkee1.3.1\\lib\\j2ee.jar;c \:\\JavaCVSDepot
\\GTS\\jre\\lib\\rt.jar;

Simple but did the trick for ajbrowser in my case. Hopefully the next
release of AJDT/ajbrowser has support for setting the bootclasspath.

If somebody could supply me with some links/hints on how to set up an
Eclipse project to patch this locally I would appreciate it (have the source
and tried to set up a project myself but there are a lot of dependancies
:-). The benefit might be that I might actually be able to contribute in the
future :-)

My immediate concern is of course to patch the AJDT 0.5.2 release as this
works for me in all other respects (didn't get the 0.6.0b to work).

So, a quick-start for new/possible contributors please?

Martin Moe Senior Knowledge Engineer
mm@computas.com
http://www.computas.com


"Martin Moe" <mm@computas.com> wrote in message
news:avk5k1$g9k$1@rogue.oti.com...
> Hi
>
> I have a large project that compiles in the shell with exactly this setup
>
> ajc -bootclasspath
> c:\Java\j2sdkee1.3.1\lib\j2ee.jar;c:\JavaCVSDepot\GTS\jre\li b\rt.jar;
> -extdirs
> C:\JavaCVSDepot\GTS\jre\lib\ext;c:\JavaCVSDepot\GTS\client\j ars\computas
> -classpath c:\java\aspectj1.0\lib\aspectjrt.jar -lenient
> @AllClasses.lst
>
> I am however not able to build it from ajbrowser or Eclipse (2.0 with
> org.aspectj.ajde_1.0.6 and org.eclipse.ajdt.ui_0.5.2). Have tweeked the
> build settings till my face turns blue. Tried setting the classpath, the
> bootclasspath and extdirs (both of the latter using 'Non-standard compiler
> options'). No such luck.
>
> My problem is then that I simply cannot control the actual build settings
> from within the GUI. This means that I cannot get my hands on the aspect
> browsing functionality for this project.
>
> Is there some inherent shortcoming in the current implementation I am
> rubbing my nose against or can somebody show me how I can invoke exactly
> this build statement from the GUI (short of hardcoding my build statement
in
> the ajbrowser/AJDT source and building it first :-)? It should be easy,
> shouldn't it :-?
>
>
> Martin Moe Senior Knowledge Engineer
> mm@computas.com
> http://www.computas.com
>
>
Re: Setting the exact build environment [message #563946 is a reply to message #15207] Fri, 10 January 2003 14:43 Go to previous message
Eclipse UserFriend
Hi Martin,
Obviously I can't reproduce your exact build environment, but here's how I
believe you can configure Eclipse to do what you want when using AJDT (this
actually uses simply the features of the Eclipse JDT that AJDT inherits):

First off for compiling...
Having created your AspectJ project, use the context menu to select the
project properties, and then select Java Build Path. Go to the libraries
tab and use "Add External Jars..." to add in the additional Jar files you
need for compilation.

THEN... go to the "Order and Export" tab and move your newly added jar
files
up in order so that they are ahead of (e.g.) rt.jar - if your project
requires this - it may be that you can omit this step.

That should now enable you to build your project. Incidentally, there's a
view in AJDT (Window->Show View->Other->AspectJ->AJDT Event Trace) that
displays diagnostic information as AJDT executes. One of the pieces of
information you'll find in that view is the exact classpath that AJDT uses
to perform a compile - can come in very handy for problem solving!!

Then, for running the compiled program:
Eclipse uses "launchers" that hold runtime configuration information for
launching applications. Because AspectJ creates plain Java class files,
AJDT
simply uses the normal Java launcher, unchanged. Choose "Run..." from the
run menu / icon, and then select "Java Application" and click "New."
Give your new configuration a name, and then click on the "Classpath" tab.
Now you need to deselect the "Use default classpath" option at the bottom
of
the page. Select the jar files in the "User classes" tab that you actually
want to run from the bootclasspath and click "Remove." The select the
"Bootstrap classes" tab and add the bootclasspath jars back in using the
"Add External Jars..." button.

Phew!! That should do it. Your launch configuration is saved so that you
only have to go through all that hassle the once.

I'd be curious to know if this works for you, and also if anyone knows a
simpler way of setting up Java/AspectJ projects in Eclipse to do this?

Of course, we'd be delighted to have you contribute to the AJDT project
too :-). I'll post instructions on how to set-up an Eclipse environment to
do that under a separate thread.

-- Adrian.
Re: Setting the exact build environment [message #563958 is a reply to message #15240] Tue, 14 January 2003 07:35 Go to previous message
Eclipse UserFriend
Hi Adrian

Meanwhile I did a local patch (i chacked (i.e. checked out and hacked :-)
the 0.5.2 release from CVS) with the same trick I described earlier in the
thread, hacking the
ProjectPropertiesAdapter.getBootClasspath

implementation in
org.eclipse.ajdt.internal.ui.ajde.ProjectProperties.

to suit my particular needs. Now, I am not quite sure why I need to have
these two jars in AJDE's bootclasspath rather than the regular classpath. I
just tweeked the ajc command till it worked and that turned out to be the
significant setting.

Ok, so right now I have to launch a run-time workbench with my chacked patch
of AJDT 0.5.2 and build my project using this workbench. Quite cumbersome
since this is a large project (624 class files). So large in fact that I had
to give -Xmx384m to the VM. you can imagine how my poor little portable
starts to sweat :-) My sanity hangs by a thread of 512M of hard memory taped
with a fair bit of patience.

I have no particular problems launching the project once I manage to build
it. Strange isn't it :-)

Anyway, I am looking forward to the new thread you promised.

Martin

"Adrian Colyer" <adrian_colyer@uk.ibm.com> wrote in message
news:avn7op$gtp$1@rogue.oti.com...
> Hi Martin,
> Obviously I can't reproduce your exact build environment, but here's how I
> believe you can configure Eclipse to do what you want when using AJDT
(this
> actually uses simply the features of the Eclipse JDT that AJDT inherits):
>
> First off for compiling...
> Having created your AspectJ project, use the context menu to select the
> project properties, and then select Java Build Path. Go to the libraries
> tab and use "Add External Jars..." to add in the additional Jar files you
> need for compilation.
>
> THEN... go to the "Order and Export" tab and move your newly added jar
> files
> up in order so that they are ahead of (e.g.) rt.jar - if your project
> requires this - it may be that you can omit this step.
>
> That should now enable you to build your project. Incidentally, there's a
> view in AJDT (Window->Show View->Other->AspectJ->AJDT Event Trace) that
> displays diagnostic information as AJDT executes. One of the pieces of
> information you'll find in that view is the exact classpath that AJDT uses
> to perform a compile - can come in very handy for problem solving!!
>
> Then, for running the compiled program:

<...snip...>

>
> I'd be curious to know if this works for you, and also if anyone knows a
> simpler way of setting up Java/AspectJ projects in Eclipse to do this?

See above.

>
> Of course, we'd be delighted to have you contribute to the AJDT project
> too :-). I'll post instructions on how to set-up an Eclipse environment to
> do that under a separate thread.
>
> -- Adrian.
>
>
Previous Topic:Setting the exact build environment
Next Topic:AJDT refactoring extension
Goto Forum:
  


Current Time: Tue Jul 15 02:21:35 EDT 2025

Powered by FUDForum. Page generated in 0.30972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top