Proficient in JBuilder: Structure of Class Library

Source: Internet
Author: User

In addition to the standard JDK classes, programs in the project refer to a variety of other classes or packages that may be developed by third parties, such as Apache, or the company's own Java class library. JBuilder automatically joins the JDK class library into the development environment, so you can use the import statement directly to refer to the required JDK package in a Java program, but a third party or a company's own class library needs to be added manually to the project's class library. Maintaining a class library can be described as the most basic skill a Java programmer needs to have. When writing a program, JBuilder may report So-and-so class "does not exist" error message, which means that jbuilder in the current project in the class library does not find the required class, then you need to do is to add the class library package to the project's class library.

In the practice of teaching and work, I often find many beginners, even some of the skilled development engineers of the engineering library feel helpless. To thoroughly sweep away this blind spot, it is necessary to make a comprehensive interpretation of how the program files in JBuilder refer to other classes, and the program files referencing other classes can be described in Figure 3-25:

In writing the program codeinsight, the remaining code of the automatic completion, view the class of help documents, in the compiler when the class reference check, when running the program class code call, JBuilder is all through the Engineering class library to provide help. When compiling/running the program, JBuilder automatically adds all the paths corresponding to the Engineering class library to the Javac/java-classpath parameter, so that both the compiler and the runtime can automatically explore the extended libraries.

Therefore, an external class or package referenced by an import statement in a Java program file must be:

-JDK's class Library

-Engineering Extension Class Library

-Other Java files in the project

The Engineering Extension class library is empty by default (some objects created through the wizard, JBuilder will automatically add the required class library to the project's extended class library, if you need to refer to a class that is not a class in the JDK class library, or other Java files in the project, Then you will need to manually add these class libraries to the engineering Extensions class library.

Typically, the class library packs the class files, resource files, and corresponding Javadoc files together and stores them in a. jar or. zip file. You can view the Extended class library of the project through the list under Project->project properties...->paths->required Libraries tab.

From Figure 3-25, we know that there are three ways to define engineering extension engineering class libraries. But each has its own different applications.

-Share other projects: all classes and engineering libraries of other projects can be shared, and in this way all classes and class libraries of other projects are added to the current project, as described in the actual combat experience of the previous section.

class libraries for-.jar and. zip Types: Reference these class libraries by specifying a third party's class package file.

-jbuilder Class Library: JBuilder class Library is independent of the specific project development environment of the class library resources, JBuilder brought a rich class library. You can also add some commonly used third-party libraries to the JBuilder class library so that any project can indirectly reference the class library directly from the JBuilder class library.

Figure 3-25 Program files refer to other classes

Hint: The JBuilder class Library provides a rich standard JDK library other common class libraries, such as processing XML Xalan and Xerces class library, Java EE Class Library, Borland Company's class library, developers can also manually maintain the JBuilder class library. However, the JBuilder class library is not directly added to the engineering Extension class Library, which means that a developer must manually add a specific class library from JBuilder to the engineering Extension class library before the program can refer to the class libraries.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.