This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 38151 - build.xml fail when tools.jar is not found in java home
Summary: build.xml fail when tools.jar is not found in java home
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 3.x
Hardware: Macintosh Mac OS X
: P4 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-16 13:47 UTC by ccuche
Modified: 2010-04-29 09:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ccuche 2003-12-16 13:47:57 UTC
build.xml checks for tools.jar in java home, and 
fails if it doesn't find them which is the case 
under MacOSX with jdk 1.4.1. It should not, as 
classes in tools.jar can be in different 
locations or even be found in a different jar 
depending on the SDK-OS provider. Anyways, if Ant 
need a class from tools.jar, he will find them if 
the classpath is well built.
Fix: remove <fail> tags within all build.xml in 
the source tree whenever tools.jar is not found 
and just echo a warning instead.
Comment 1 rbalada 2003-12-16 15:40:05 UTC
Not sure we want to fix this. You may also set property jdkhome-valid
to any value to workaround this (at least in module nbbuild).

Jesse would you comment on this? I guess you are the author of the
jdkhome checking code.
Comment 2 Jesse Glick 2003-12-16 20:41:14 UTC
Changing the <fail> to <echo>WARNING...</echo> makes sense to me.
Comment 3 Tomas Hurka 2003-12-17 09:08:06 UTC
Please see Mac OS X howto at http://www.netbeans.org/kb/articles/mac.html
You can simply add -Djavahome-valid=true option to commandline when you start 
build.
Comment 4 Jesse Glick 2004-05-01 16:01:30 UTC
Tim is this now FIXED?
Comment 5 _ tboudreau 2004-05-01 21:00:44 UTC
It's working on being fixed.  As we discussed now, it works now, but not for the right 
reason.

I imagine I'll swap it with something like 

<available classname="com.apple.eawt.Application" property="isMac"/>
...

I seem to remember some way to declare an if/unless based on the platform (more 
granular than is it unix or isn't it), but after digging through various scripts and the ant 
docs for about an hour I haven't found it.

Comment 6 _ tboudreau 2004-05-01 21:26:53 UTC
It's fixed now:

<available classname="com.apple.eawt.Application" property="is-mac"/>
...

  <target name="setup-jdkhome-apple" depends="setup-jdkhome-1" if="is-mac">
      <property name="jdkhome-valid" value="${java.home}/../Classes/classes.jar"/> 
  </target>

AFAIK this should work everywhere, and allow the jar to be indexed by those things that 
need to in the build process.

Checking in build.xml;
/cvs/nbbuild/build.xml,v  <--  build.xml
new revision: 1.461; previous revision: 1.460
done
Checking in default.xml;
/cvs/nbbuild/default.xml,v  <--  default.xml
new revision: 1.10; previous revision: 1.9
done
Comment 7 Tomas Hurka 2004-05-03 09:02:08 UTC
I don't like this fix since it depends on jar name. As Tim already knows - we ought to 
avoid assumptions about names of jars.

If you really need to do it this way I would suggest:

 <target name="setup-jdkhome-apple" depends="setup-jdkhome-1" if="is-mac">
      <property name="jdkhome-valid" value="true"/> 
  </target>
Comment 8 _ tboudreau 2004-05-03 10:57:57 UTC
I don't like depending on jar names either, but Jesse pointed out that some modules (?) 
want to index the jar's contents as part or the build process (or something - I'm guessing 
that's what), and so they just *have* to have a path to the jar.  Other than for pre-building 
a code completion database, that sounds like a bug in those module's build process, but 
who am I to say...
Comment 9 ccuche 2004-05-03 12:32:01 UTC
Sorry, but I really think it's wrong to rely on any jar name within
the SDK, as it is a non standardized fileystem layout.
If any module needs to index files within tools.jar, these module
should  find the jar that provide the given class they look for and
index all the files within this jar.
The fix make the whole build process weaker, as it introduce
filesystem struture and OS depencies...what take place if Sun or Apple
change the name of the jar in a futur release?!
Changing the <fail> to <echo>WARNING...</echo> should be sufficient
for other module to fail building if the class it uses in tools.jar is
not found. With onyl the compiler error (and the warning), it's easy
to trace back the problem to the missing jar, isn't it?
Comment 10 Jesse Glick 2004-05-03 17:55:32 UTC
Need to review usage of path to tools.jar in various modules that rely
on it (e.g. debuggerjpda). Ideally JDK tools should be accessible in
the compilation classpath only of those modules which explicitly
request it.

Of course it would be preferable to not make assumptions about JDK
layouts, but we *do* have to make some assumptions because we are
building against JPDA interfaces, etc., which are not part of the JRE.
If vendors make changes to file layout, we may need to track them.

Note that the runtime launcher also searches for JDK-specific JARs, AFAIK.
Comment 11 _ tboudreau 2004-06-27 03:36:47 UTC
Reassigning - I'm definitely not the person to assess the debugger's
usage of tools.jar.

Comment 12 Jan Jancura 2004-09-08 09:41:27 UTC
As there is no <fail> tag in debugger build xmls, this issue is
probably fixed.
Feel free to reopen it, if you see some other possible imporvements.
Comment 13 Jesse Glick 2004-09-08 15:38:35 UTC
The <fail> part was fixed long ago. This was assigned to debugger
because of its usage of tools.jar, cf. e.g. my comments on May 03. But
I am too tired to keep tracking this issue.
Comment 14 Quality Engineering 2010-04-29 09:15:41 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.