What is the purpose of `javac.profile` switch

What is the meaning of the parameter javac.profile: 11?
How does it differ from javac.source and javac.target

When I use the profile switch, my bundles get java.* import packages.
(Which are not yet working inside Eclipse PDE targets :frowning_face: )
When using javac.source: 11 and javac.target: 11 it is working as expected. I’m just curious what the profile switch is used for.

It is only for Java 8 to specify the desired profile: compact1, compact2, or compact3. The value is used for the javac -profile option.

thx for the clarification.

What would you suggest as best practice for post java 8 based project development with bndtools in Eclipse?

  • Configure the Eclipse workspace compilation settings?
  • Configure project specific org.eclipse.jdt.core.prefs and import into bndtools?
  • Configure javac.source/target inside cnf/build.bnd or project specific?

Configure javac.source and javac.target to the same number. Don’t set javac.profile. Then the Bnd Gradle plugin will use the --release option for javac. Configure the eclipse settings to match.

thank you for the advice

Note also that @pkriens has a PR that will hopefully be merged soon, which fully automates the task of syncing the Bnd workspace with the Eclipse workspace. See [bndtools explorer] Refresh workspace from disk by pkriens · Pull Request #4510 · bndtools/bnd · GitHub. That will simplify a lot of the issues with (eg) making sure that bnd’s javac.source matches Eclipse’s.

I’ve merged it.

The current bndtools snapshot contains some key changes in the builder that should build a tad faster. However, most important is the change in the Bndtools Explorer refresh button. It will do a full sync on the workspace. This should solve many problems when your workspace has hard to get rid of errors after a refresh.