• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • How to install bnd
      • Guided Tour
      • Guided Tour Workspace & Projects
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Introduction
      • Concepts
      • Best practices
    • Build and Development
      • Project Setup
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • -noimportjava BOOLEAN
    Analyzer

    Do not import java.* packages.

    Prior to OSGi Core R7, it was invalid for the Import-Package header to include java.* packages. So Bnd would never include them in the generated Import-Package header. In OSGi Core R7, or later, it is now permitted to include java.* packages in the Import-Package header. This allows the OSGi framework validate the execution environment can supply all the java packages required by a bundle. This can avoid a NoClassDefFoundError during execution of the bundle due to a missing java.* package required by the bundle.

    Bnd will now generate the Import-Package header including referenced java.* packages when either the bundle imports the org.osgi.framework package from OSGi Core R7, or later, or when the bundle includes class files targeting Java 11, or later.

    The -noimportjava instruction can be used to tell Bnd not to include referenced java.* packages in the generated Import-Package header.

    For example:

    -noimportjava: true
    

    You can use the Import-Package instruction to control which referenced java.* packages should be imported.

    For example:

    Import-Package: java.util.*, !java.*, *
    

    will only import java.util.* packages and no other java.* packages.

Search
    • Home