当前页面: 开发资料首页 → Netbeans 专题 → NetBeans IDE Guide for JBuilder Users
摘要: If you have used JBuilder to develop Java applications in the past but are looking to move to NetBeans IDE, you can easily get started. Here is a general guide to the things you need to do to start NetBeans IDE, import your JBuilder projects into NetBeans IDE, and continue work on your projects
Download NetBeans IDE from http://www.netbeans.info/downloads/index.php.
Once you have downloaded NetBeans IDE, you can start work on importing existing projects from the JBuilder environment into NetBeans IDE.
All NetBeans IDE projects are all based around the Ant build tool, which makes NetBeans projects easily portable to other environments. However, you do not necessarily need to know anything about Ant to use NetBeans IDE. When you create standard IDE projects, you can handle all project configuration through the IDE's user interface. The IDE maintains the Ant script for you.
Conceptually, there are two types of projects:
To import a general Java application into NetBeans IDE, follow these general steps:
You can download the JBuilder Project Importer Module to import projects that you have developed with JBuilder 2005 into NetBeans IDE. (For NetBeans IDE 5.5, this module can also import projects developed with JBuilder 2006). This module eliminates or greatly reduces the amount of work you have to do get your projects working in NetBeans IDE as they worked in JBuilder.
To download the JBuilder Project Importer module:
Once you have the importer module added, you can import Java SE projects from JBuilder with a simple wizard.
To import a general Java project into NetBeans IDE:
In the NetBeans IDE 5.5 version of the project importer, you also are presented with JBuilder User Home and JBuilder Installation Folder. Filling in these fields (where appropriate) makes it easier for the IDE to handle any dependencies that the project has on other projects or libraries.
The IDE leaves the project sources where they are so that you can still work with them in JBuilder.
To build your application, right-click the project's node in in the Projects window and choose Build Project.
To run your application in the IDE, right-click the project's node in in the Projects window and choose Run Project.
Note:When you build and run applications in NetBeans IDE, the output also includes output from the Ant script that the project is based on. If you are not specifically concerned with the working of the Ant script, you can ignore that part of the output.
For more information on importing projects into NetBeans IDE 5.0, see http://www.netbeans.org/kb/50/import_j2se.html
NetBeans IDE does not have a special feature to convert JBuilder web and enterprise projects into projects in NetBeans IDE. However, importing existing projects into NetBeans IDE is fairly straightforward.
To import a web or enterprise application project, follow these general steps:
Before setting up a project in the IDE, make sure that the server that you want to develop for is registered in the IDE. Otherwise you will not be able to complete project setup.
The bundled Tomcat Web Server is registered with the IDE automatically. If you installed the NetBeans IDE 5.0/Sun Java System Application Server bundle, a local instance of the application server is registered automatically. If you want to deploy to an instance of an unbundled application server, such as the Sun Java System Application Server, JBoss, or WebLogic, you have to register a local instance with the IDE.
To register an application server instance with the IDE:
You can use either of the following techniques for setting up your project in NetBeans IDE:
When converting JBuilder projects to NetBeans IDE, the way you convert the projects depends largely on these questions:
If you have a project that you have just started developing or which has not yet become too complex, you will probably want to convert the project into a standard NetBeans IDE project using a "With Existing Sources" template. Doing so gives you full integration with all of NetBeans IDE's features.
If you have a project that is very complex and/or which you do not anticipate extensively modifying, you might find that it is most practical to use a NetBeans IDE free-form project (using a "With Existing Ant Script" template). Creating a free-form project enables you to easily build and modify the project based on an Ant script exported from JBuilder. The IDE uses the Ant script you designate to handle standard project commands, such as building and running the project.
The advantage of this approach is that you do not have to reconfigure your project from scratch. However, if you want full IDE integration using this approach, you might need to some manual configuration to make some features work (such as debugging, code completion, and some other editing feataures). See Advanced Free-Form Project Configuration Guide
To import a web or enterprise project into NetBeans IDE as a standard project:
To import a web or enterprise project into NetBeans IDE as a free-form project:
After creating the NetBeans IDE project, you might need to use the Project Properties dialog box to configure the way the project is built and run.
You can access the Project Properties dialog box by right-clicking the project's main node in the Project window and choosing Properties.
To build your application, right-click the project's node in in the Projects window and choose Build Project.
To run your application in the IDE, right-click the project's node in in the Projects window and choose Run Project.
Note: When you build and run applications in NetBeans IDE, the output also includes output from the Ant script that the project is based on. If you are not specifically concerned with the working of the Ant script, you can ignore that part of the output.
For more general information on importing web projects into NetBeans IDE 5.0, see http://www.netbeans.org/kb/50/import_web.html
For more general information on importing enterprise projects into NetBeans IDE 5.0, see http://www.netbeans.org/kb/50/import_j2ee.html
Projects in the IDE are represented by a folder rather than a file.
If you close a project, you can open it again by choosing the File | Open Project command
and navigating to the folder containing the project's build script. Project folders are
marked with the icon.
Where is the NetBeans IDE project file?
NetBeans IDE does not have a single project file. Instead there is a
project folder (called nbproject) that contains various pieces of project metadata.
Can I visually edit my JBuilder Swing forms in NetBeans IDE?
Unfortunately, no. However, you might find it worthwhile to
use the Matisse GUI Builder within NetBeans IDE to recreate
syour legacy forms. Matisse provides makes use of the
new GroupLayout layout manager and slick WYSIWIG features to take GUI design to
a whole new level of simplicity.
For more detailed information on using NetBeans IDE 5.0, you can investigate the following links:
Using NetBeans IDE 5.0. A medium-sized guide to NetBeans IDE's features.
NetBeans 5.0 Tutorials, Guides, and Articles page. Lists the main tutorials and guides for NetBeans IDE 5.0 and provides links to others.
NetBeans IDE FAQs. A comprehensive list frequently asked questions and their answers.
nbusers mailing list. An active mailing list of NetBeans IDE users. You can search the archives or join the list and ask your own questions.