Compact Profiles

Author: Tomas Zezula

Version 0.1

Setting Compact Profile in Ant Based J2SE Project

The Compact Profile for a project is set in File/Project Properties/Sources. The project Source/Binary Format has to be JDK 8. File:Profile_project_sources.png

When a compact profile is set the IDE checks compact profile violations and the created project jar file contains the Profile attribute.

Compact Profile Violations

The violations in sources are marked as errors in editor as well as in project tree. They are also listed in Action Items (Window/Action Item). File:Profiles_editor_errors.png

When a new jar or subproject is added to a project or the project's profile is lowered the IDE checks the referenced jars for Profile attribute and marks the project as broken if it contains a jar requiring higher profile. File:Profiles_project_problems.png

The problem resolution offers either increasing of the project compact profile to required level or removing the library with incompatible profile. File:Profiles_project_problems_resolve.png

The library without a Profile attribute can be added without any warnings because the class file constant pool inspection is expensive for large jar files.

The IDE provides class file constant pool inspection of both project sources (classes from IDE internal cache used for compile on save are used) and classes in libraries. The analyses is available in Source/Inspect. File:Profiles_constantpool_inspect.png

By default the inspection verifies the classes according to project selected compact profile however it can be changed by switching configuration to Default or other named configuration and pressing the Manage button. File:Profiles_constantpool_inspect_config.png

The result of the inspection shows a project tree with affected files and violations. File:Profiles_constantpool_inspect_result.png

Not logged in. Log in, Register

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