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.
Commit validation has been failing for my on Mac for the past week. Usually I expect a few random failures but sometime mid week I started getting a totally different failure. I believe my failure is on the dt.jar dependency (per #24499d81bb5c). > [junit] Warning - could not install module Form Editor > [junit] Form Editor - This module requires JDKHOME/lib/dt.jar to be accessible. > [junit] This file was not found. Usually this means you are trying to run the IDE with the JRE instead of the full JDK. > [junit] If so, please use the --jdkhome command line option to specify a JDK installation. > [junit] For more information see http://wiki.netbeans.org/FaqRunningOnJre I have set my JDKHOME, JAVA_HOME, and my netbeans_jdkhome in the conf file to: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/ I have even added to my CLASSPATH: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/dt.jar > [junit] Java Home = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home The worse part of this failure is that it take 15 minutes to fail out completely when you actually see this error about 45 seconds into the test. Shouldn't we failout (and stop tests) if dt.jar is not found? I have been struggling with commit validation the past three days so any help from Mac users would be extremely appreciated. Commit Validation Output: http://wiki.netbeans.org/attach/JoelleLam/output.txt I am running test from a clean build with no modification from trunk
Yarda's on vacation so I might need to take on this one.
What does System.getProperty("java.home") normally report for you? Does /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/dt.jar exist by default?
And what does System.getProperty("java.class.path") normally report? (E.g. in a hello-world j2seproject.)
BTW the presence of /System/Library/Java/Extensions/junit-4.1.jar is a little disturbing. Why does this file exist? Generally you should not be running builds and tests with extra JARs dumped in your extension CP. NbModuleSuite, like pretty much everything else in NB, intentionally ignores your $CLASSPATH.
java.home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home java.class.path: /Users/joelle/NetBeansProjects/JavaApplication1/build/classes dt.jar is located in Home by default. Macintosh-89:Versions joelle$ find /System/Library/Frameworks/JavaVM.framework/Versions/ -name dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.4.2/Classes/dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.4.2/Home/lib/dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.5.0/Classes/dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.5.0/Home/lib/dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.6.0/Classes/dt.jar /System/Library/Frameworks/JavaVM.framework/Versions//1.6.0/Home/lib/dt.jar The JUnit jar is residual that was required at one point to get junit working on my system. I tried to remove it recently and almost totally forgot about. This would be causing this problem though, right?
Do remove the junit.jar, though it is unlikely to be causing this problem. Try the following patch (ant -f nbjunit/build.xml && ant commit-validation) and let me know if it works for you: diff --git a/nbjunit/src/org/netbeans/junit/NbModuleSuite.java b/nbjunit/src/org/netbeans/junit/NbModuleSuite.java --- a/nbjunit/src/org/netbeans/junit/NbModuleSuite.java +++ b/nbjunit/src/org/netbeans/junit/NbModuleSuite.java @@ -419,7 +419,11 @@ } } - File jdkLib = new File(new File(System.getProperty("java.home")).getParentFile(), "lib"); + File jdkHome = new File(System.getProperty("java.home")); + if (!"Mac OS X".equals(System.getProperty("os.name"))) { + jdkHome = jdkHome.getParentFile(); + } + File jdkLib = new File(jdkHome, "lib"); if (jdkLib.isDirectory()) { for (File jar : jdkLib.listFiles()) { if (jar.getName().endsWith(".jar")) {
Created attachment 63786 [details] commit validation with patch
The commit validation is now loading the dt.jar with the patch given. The other failures look more like failures I am used to (unfortunately mac commit-validation has never been stable).
So this fixes the problem you were having, or no? I am confused by your last comment.
Will not push until I get some kind of positive confirmation that the patch works. I cannot test it myself (other than that it does not harm C/V on Linux).
*** Issue 139086 has been marked as a duplicate of this issue. ***
Guys, please help us verify that Jesse's patch is correct.
I verified that Jesse's patch fixes the problem with inaccessible dt.jar on Mac.
It works for me too.
OK. core-main #73e6d83257f0
Integrated into 'main-golden', available in NB_Trunk_Production #308 build Changeset: http://hg.netbeans.org/main/rev/73e6d83257f0 User: Jesse Glick <jglick@netbeans.org> Log: Issue #138721: commit validation fails on Macs due to tools.jar/dt.jar not being in CP.