buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eung-ju Park" <eun...@gmail.com>
Subject Re: There is no tools.jar on Mac OS X JDK
Date Sun, 14 Sep 2008 12:38:28 GMT
Yes, It works well on my OS X. Thank you.

On Sun, Sep 14, 2008 at 4:06 AM, lacton <lacton@users.sourceforge.net>wrote:

> Committed revision 695005.  That should fix the issue on OS X.  Can you
> confirm?
>
> The next step for me is to extend the tools_jar logic to the apt
> method.  First, I want to add some tests.
>
> Lacton
>
> On Sat, Sep 13, 2008 at 7:15 PM, lacton <lacton@users.sourceforge.net>
> wrote:
> > Thank you for your feed back.
> >
> > I didn't know File.exist? does not support 'nil'.  I'm disappointed.
> > I'm used to more programmer-friendly APIs in the ruby world. :-(
> >
> > I'll fix it right away.
> >
> > Lacton
> >
> > On Sat, Sep 13, 2008 at 5:36 PM, Eung-ju PARK <eungju@gmail.com> wrote:
> >> I ran spec. spec complain about tools_jar variable is nil.
> >>
> >> --- error message ---
> >> can't convert nil into String
> >>
> >> /Users/eungju/src/buildr/lib/buildr/java/compilers.rb:63:in `exist?'
> >>
> >> 61        tools_jar = [File.expand_path('lib/tools.jar',
> ENV['JAVA_HOME']),
> >> File.expand_path('../lib/tools.jar', ENV['JAVA_HOME'])].
> >> 62          find { |path| File.exist?(path) }
> >> 63        dependencies << tools_jar if File.exist?(tools_jar)
> >> 64        cmd_args << '-classpath' <<
> >> dependencies.join(File::PATH_SEPARATOR) unless dependencies.empty?
> >> 65        source_paths = sources.select { |source|
> File.directory?(source) }
> >> 66# gem install syntax to get syntax highlighting
> >>
> >> I tries to find tools.jar on all of my install JDKs, but I can't.
> >> I found Mac OS X JDK doesn't provides tools.jar. See
> >>
> http://developer.apple.com/documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html#//apple_ref/doc/uid/TP40001884-SW1
> >>
> >> Javac.compile should handle this case.
> >>
> >> Index: lib/buildr/java/compilers.rb
> >> ===================================================================
> >> --- lib/buildr/java/compilers.rb        (revision 694959)
> >> +++ lib/buildr/java/compilers.rb        (working copy)
> >> @@ -60,7 +60,7 @@
> >>         # but maybe the JRE.
> >>         tools_jar = [File.expand_path('lib/tools.jar',
> ENV['JAVA_HOME']),
> >> File.expand_path('../lib/tools.jar', ENV['JAVA_HOME'])].
> >>           find { |path| File.exist?(path) }
> >> -        dependencies << tools_jar if File.exist?(tools_jar)
> >> +        dependencies << tools_jar if tools_jar &&
> File.exist?(tools_jar)
> >>         cmd_args << '-classpath' <<
> dependencies.join(File::PATH_SEPARATOR)
> >> unless dependencies.empty?
> >>         source_paths = sources.select { |source| File.directory?(source)
> }
> >>         cmd_args << '-sourcepath' <<
> source_paths.join(File::PATH_SEPARATOR)
> >> unless source_paths.empty?
>



-- 
* LukeSkywalker: Is the dark side stronger?
* MasterYoda: No...no...no. Quicker, easier, more seductive.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message