• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • 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
      • bnd CLI 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
  • ee

    Prev Next
    Analyzer
    Get the highest Java Execution Environment (EE) required by the bundle

    Summary

    The ee macro returns the name of the highest Java Execution Environment (EE) required by the classes in the current bundle being analyzed. This is determined by analyzing the bytecode version of all classes in the JAR.

    Syntax

    ${ee}
    

    Parameters

    None - this macro takes no parameters.

    Behavior

    • Analyzes all class files in the bundle
    • Determines the highest Java class file version used
    • Returns the corresponding EE name (e.g., “JavaSE-1.8”, “JavaSE-11”, “JavaSE-17”)
    • Available during bundle analysis and JAR generation

    Examples

    Set the Bundle-RequiredExecutionEnvironment based on analyzed classes:

    Bundle-RequiredExecutionEnvironment: ${ee}
    

    Use in conditional logic:

    # Check if Java 11+ is required
    java11plus=${if;${vcompare;${ee};JavaSE-11};true;false}
    

    Document the requirement:

    Bundle-Description: Requires ${ee} or higher
    

    Use Cases

    • Automatically determining minimum Java version requirements
    • Validating that bundle dependencies match execution environment
    • Generating accurate OSGi manifest headers
    • Documenting Java version requirements
    • Ensuring compatibility across different Java versions

    Notes

    • The EE is determined by bytecode analysis, not source code
    • Returns the highest (most recent) EE found among all classes
    • The EE name follows OSGi execution environment naming conventions
    • Common values include: JavaSE-1.8, JavaSE-11, JavaSE-17, JavaSE-21
    • This is typically used to set the Bundle-RequiredExecutionEnvironment header

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home