Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 197295 - Project files changed by NetBeans no longer build correctly
Project files changed by NetBeans no longer build correctly
Product: java
Classification: Unclassified
Component: Project
PC Windows XP
: P3 (vote)
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
Reported: 2011-03-31 18:23 UTC by ddmiller
Modified: 2011-04-05 18:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

Image of New Java Project dialog (92.01 KB, image/pjpeg)
2011-04-04 22:43 UTC, ddmiller

Note You need to log in before you can comment on or make changes to this bug.
Description ddmiller 2011-03-31 18:23:00 UTC
Every so often when I attempt to do a Clean and Build, I get the following error building:

Deleting: C:\Fastlane\java\ParseBuilder\build\
Updating property file: C:\Fastlane\java\ParseBuilder\build\
C:\Fastlane\java\ParseBuilder\nbproject\build-impl.xml:1024: The following error occurred while executing this line:
C:\Fastlane\java\ParseBuilder\nbproject\build-impl.xml:1071: The following error occurred while executing this line:
C:\Fastlane\java\designer\nbproject\build-impl.xml:86: The J2SE Platform is not correctly set up.
 Your active platform is: default_platform, but the corresponding property "platforms.default_platform.home" is not found in the project's properties files. 
 Either open the project in the IDE and setup the Platform with the same name or add it manually.
 For example like this:
     ant<path_to_property_file> jar (where you put the property "platforms.default_platform.home" in a .properties file)
  or ant -Dplatforms.default_platform.home=<path_to_JDK_home> jar (where no properties file is used)
BUILD FAILED (total time: 0 seconds)

I did not change any of the properties files or project files created.  If I delete the project and start over everything is fine.

Which project files do you need to see when this happens?

Product Version: NetBeans IDE 7.0 Beta 2 (Build 201102140001)
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 21.0-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\dm185016\.netbeans\7.0beta2
Comment 1 Jesse Glick 2011-04-04 21:47:06 UTC
Seems like you specified a nondefault Java platform in the Libraries panel, yet 'default_platform' is supposed to refer only to the (you guessed it!) default platform. Attaching the whole project or at least build.xml plus the nbproject dir, as well as and config/Services/Platforms/org-netbeans-api-java-Platform from the user directory, might shed some light on the problem. But these files would probably just confirm that you have in and <explicit-platform...> in project.xml, which should not happen. The question is how you got the IDE to write this incorrect metadata; to diagnose that we would need steps to reproduce the problem from scratch.
Comment 2 ddmiller 2011-04-04 22:43:53 UTC
Created attachment 107492 [details]
Image of New Java Project dialog

Picture of New Java Project dialog showing Build script name as nbbuild.xml not build.xml.  I never set this field to anything.  This is the default value that always comes up.
Comment 3 ddmiller 2011-04-04 22:50:39 UTC
Currently I cannot recreate.

Two theories about cause:

1.  Running multiple versions of NB on the same projects.  I had 6.7.1, 6.9.1 and 7.0 Beta 2 (now RC1).  I ran 6.7.1 for UML features, then I accidently ran 6.9.1.  I killed 6.9.1 and then ran 7.0 beta2.  

2.  Two different build scripts in directory.  The older versions created build.xml.  These versions were committed to SVN.  The 7.0 beta 2 (and RC1) versions by default create nbbuild.xml not build.xml.  So there were 2 build scripts in the directory.  When I "fixed" my problem, I deleted by hand all build scripts and directories and created new projects with existing source.  The attached image shows what comes up by default when I select that option.  As you can see, it builds nbbuild.xml not build.xml.  Would having both cause this kind of problem?
Comment 4 Tomas Zezula 2011-04-05 16:22:55 UTC
The nbbuild.xml is preferred name of build script in case when build.xml already exists to prevent collisions with existing build file. I think it's there from 6.8 before it the Wizard rejected to create a project.
Anyway I don't understand how you created 2 projects in single folder (this is unsupported) and the wizard reject it as the "nbproject" folder exists.
Please attach the whole nbproject folder, the build.xml, the nbbuild.xml and describe how you has created the second project.
Comment 5 ddmiller 2011-04-05 17:18:29 UTC
Several of my projects were originally created years ago using NB 6.5.  These project files were named build.xml.  They are committed to SVN.  I recently recreated some of the project files using NB 7.0 when I installed it.  These project files were named nbbuild.xml.  When I did an SVN update, it restored the build.xml files to the project directories.  Now I have both build.xml and nbbuild.xml in the same directory.  I thought this might be the problem since in order to get rid of the original problem I reported, i had to regenerate all my projects.  However, as a test, I backed up the new stuff and updated from SVN.  Now I have both in the project files.  I did a Clean and Build.  No problemS!  This is different symptom than before.  Of course since I originally reported the problem, I switched from Beta2 to RC1.

If it happens again, I will try to isolate the problem again and reopen this problem.
Comment 6 Tomas Zezula 2011-04-05 17:27:33 UTC
>project files were named build.xml.  They are committed to SVN.  I recently
>recreated some of the project files using NB 7.0 when I installed it.  These
>project files were named nbbuild.xml.
Yes but you have to delete the nbproject folder before you was able to recreate them as the IDE prevents this. You should just update the projects. The IDE used the nbbuild.xml as the build.xml already existed.
You probably restored the nbproject folder from VCS and this caused the problems.
Comment 7 ddmiller 2011-04-05 17:39:29 UTC
Fine.  I want to be able to store project files in SVN.  Which files are required to share projects with other users?



How about 


Which of these can safely be shared with multiple users thru SVN?
What does each do?  Which is specific to each user (those I don't want to check in)
Is there an explanation of the files anywhere?  Which manual do I need to RTFM :-)

I can't ever find any useful info in the help system so I don't use it.
Comment 8 Tomas Zezula 2011-04-05 17:51:10 UTC
In general everything except of private/** should be in the VCS.

Here comes some short description:

nbbuild.xml                                      == build.xml   - It's an top level build script where you can override the default behavior. It should be shared                                      - manifest file added into META-INF by build. Should be shared

nbproject/build-impl.xml             - automatically generated build script. When you open a project in newer IDE it's regenerated. CRCs stored in are used to regenerate it. In fact it's regenerated when it's missing or when it has an older version when you open the project. But it should be shared as well to be able to do headless build outside of the IDE. When the build-impl.xml is updated you see some strange changes in VCS diff which may be strange.

nbproject/       - the CRC file used to regenerate the build-imp.xml. The same sharing policy as in case of build-impl.xml

nbproject/        - the public project metadata. Contains project set up. Should be shared.

nbproject/project.xml                   - Also the public project metadata. Should be shared.

nbproject/private/   -  Per user config files should not be shared.
nbproject/private/  - Per user config files should not be shared.
nbproject/private/private.xml              - Per user config files should not be shared.

I agree that it should be described somewhere in doc. Adding doc to cc list.
Comment 9 ddmiller 2011-04-05 17:57:39 UTC
Thanks for the information.  That is very helpful.  That's about what I thought but I have been hesitant to put project files in SVN.  Someone else put those files in but they also put in the private files and messed a lot of people up.  I removed most of the files to fix problems.

If (can) I modify the manifest file, will my mods be trashed by regeneration?
Comment 10 Tomas Zezula 2011-04-05 18:01:44 UTC
>If (can) I modify the manifest file, will my mods be trashed by regeneration?
No the manifest is generated just once (when you create the project).
It's not affected by regeneration.

Also the build of the project automatically may add some additional elements into the META-INF/MANIFEST.MF which are not in your (Class-Path, Main-Class). They are added if
the project has set the main class.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo