You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Roman Bruggisser <ro...@swissonline.ch> on 2005/07/31 17:42:14 UTC

[m2] Adding tools.jar to classpath

Hi

 

I'm new to maven and I'm wondering if there is a way to add tools.jar to the
classpath without placing it in the repository.

Thanks for any ideas.

 

Roman


Re: [m2] Adding tools.jar to classpath

Posted by Brett Porter <br...@gmail.com>.
Hi Matthew,

Something along those lines is probably a good idea. Can you file it in JIRA?

- Brett

On 8/27/05, Matthew Pocock <ma...@ncl.ac.uk> wrote:
> I am having trouble with adding tools.jar to my classpath. I'm compiling
> against both the javadoc and apt APIs.
> 
> Tinkering with the bootclasspath or manually putting tools.jar into my local
> repository are both icky - they work for me but not for anybody else building
> the project. Since every jdk has tools.jar,  could we not just have it
> recognised as a dependency something like this and have m2 glue it in from
> the jdk lib directory?
> 
> <dependency>
>   <groupId>sun.jdk</groupId>
>   <artifactId>tools</artifactId>
>   <type>jar</type>
>   <scope>provided</scope>
> </dependency>
> 
> On Sunday 31 July 2005 16:51, Kenney Westerhof wrote:
> > On Sun, 31 Jul 2005, Roman Bruggisser wrote:
> >
> > Hi,
> >
> > There aren't any. However it should be on the classpath if you use the
> > jdk.
> >
> > A better solution is to add it to the classpath at runtime.
> > See
> > http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-compiler/plex
> >us-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compile
> >r/javac/JavacCompiler.java?rev=2369&view=markup for an example.
> >
> > -- Kenney
> >
> > > Hi
> > >
> > >
> > >
> > > I'm new to maven and I'm wondering if there is a way to add tools.jar to
> > > the classpath without placing it in the repository.
> > >
> > > Thanks for any ideas.
> > >
> > >
> > >
> > > Roman
> >
> > --
> > Kenney Westerhof
> > http://www.neonics.com
> > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Adding tools.jar to classpath

Posted by Matthew Pocock <ma...@ncl.ac.uk>.
I am having trouble with adding tools.jar to my classpath. I'm compiling 
against both the javadoc and apt APIs.

Tinkering with the bootclasspath or manually putting tools.jar into my local 
repository are both icky - they work for me but not for anybody else building 
the project. Since every jdk has tools.jar,  could we not just have it 
recognised as a dependency something like this and have m2 glue it in from 
the jdk lib directory?

<dependency>
  <groupId>sun.jdk</groupId>
  <artifactId>tools</artifactId>
  <type>jar</type>
  <scope>provided</scope>
</dependency>

On Sunday 31 July 2005 16:51, Kenney Westerhof wrote:
> On Sun, 31 Jul 2005, Roman Bruggisser wrote:
>
> Hi,
>
> There aren't any. However it should be on the classpath if you use the
> jdk.
>
> A better solution is to add it to the classpath at runtime.
> See
> http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-compiler/plex
>us-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compile
>r/javac/JavacCompiler.java?rev=2369&view=markup for an example.
>
> -- Kenney
>
> > Hi
> >
> >
> >
> > I'm new to maven and I'm wondering if there is a way to add tools.jar to
> > the classpath without placing it in the repository.
> >
> > Thanks for any ideas.
> >
> >
> >
> > Roman
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [m2] Adding tools.jar to classpath

Posted by Roman Bruggisser <ro...@swissonline.ch>.
Setting MAVEN_OPTS to -Xbootclasspath\a:%JAVA_HOME%\lib\tools.jar works for
me (WinXP, J2SE 5.0). But it may be a bit different for other JDKs.


Roman



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Adding tools.jar to classpath

Posted by Kenney Westerhof <fo...@neonics.com>.
On Sun, 31 Jul 2005, Andy Glick wrote:

> Is there a specific reason why tools.jar can't or shouldn't be placed in
> the JDK's JRE/lib/ext directory. I've been doing that for about 7 years
> now, and I haven't been aware of any problems. But maybe I don't know
> what to look out for.

Not really, it just ends up in the classpath then. A few reasons though:

- tools.jar is part of the JDK, not the JRE, so it wasn't meant to be put
  there;
- it'll only work for you :)

--
Kenney Westerhof

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Adding tools.jar to classpath

Posted by Andy Glick <an...@acm.org>.
Roman Bruggisser wrote:

>>I'm new to maven and I'm wondering if there is a way to add tools.jar to the
>>classpath without placing it in the repository.
>>
>>Thanks for any ideas.


Kenney Westerhof wrote:
> On Sun, 31 Jul 2005, Roman Bruggisser wrote:
> 
> Hi,
> 
> There aren't any. However it should be on the classpath if you use the
> jdk.
> 
> A better solution is to add it to the classpath at runtime.
> See
> http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-compiler/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java?rev=2369&view=markup
> for an example.
> 


Is there a specific reason why tools.jar can't or shouldn't be placed in the JDK's JRE/lib/ext directory. I've been doing that for about 7 years now, and I haven't been aware of any problems. But maybe I don't know what to look out for.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Adding tools.jar to classpath

Posted by Kenney Westerhof <fo...@neonics.com>.
On Sun, 31 Jul 2005, Roman Bruggisser wrote:

Hi,

There aren't any. However it should be on the classpath if you use the
jdk.

A better solution is to add it to the classpath at runtime.
See
http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-compiler/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java?rev=2369&view=markup
for an example.

-- Kenney
> Hi
>
>
>
> I'm new to maven and I'm wondering if there is a way to add tools.jar to the
> classpath without placing it in the repository.
>
> Thanks for any ideas.
>
>
>
> Roman
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org