# What is the purpose of \`javac.profile\` switch

**URL:** <https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115>\
**Category:** GENERAL\
**Created:** [March 23, 2021, 10:56am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115 "2021-03-23T10:56:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterkir](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/peterkir/32/28_2.png) [@peterkir](https://bnd.discourse.group/u/peterkir)\
**Post date:** [March 23, 2021, 10:56am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/1 "2021-03-23T10:56:31Z")

</div>

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 ☹ )  
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.

---

<div class="post-metadata">

**Author:** ![bjhargrave](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/bjhargrave/32/10_2.png) [@bjhargrave](https://bnd.discourse.group/u/bjhargrave)\
**Post date:** [March 23, 2021, 11:29am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/2 "2021-03-23T11:29:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peterkir](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/peterkir/32/28_2.png) [@peterkir](https://bnd.discourse.group/u/peterkir)\
**Post date:** [March 23, 2021, 11:38am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/3 "2021-03-23T11:38:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bjhargrave](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/bjhargrave/32/10_2.png) [@bjhargrave](https://bnd.discourse.group/u/bjhargrave)\
**Post date:** [March 23, 2021, 11:57am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/4 "2021-03-23T11:57:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peterkir](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/peterkir/32/28_2.png) [@peterkir](https://bnd.discourse.group/u/peterkir)\
**Post date:** [March 23, 2021, 12:09pm UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/5 "2021-03-23T12:09:51Z")

</div>

thank you for the advice

---

<div class="post-metadata">

**Author:** ![kriegfrj](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/kriegfrj/32/24_2.png) [@kriegfrj](https://bnd.discourse.group/u/kriegfrj)\
**Post date:** [March 24, 2021, 2:25am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/6 "2021-03-24T02:25:01Z")

</div>

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](https://github.com/bndtools/bnd/pull/4510). That will simplify a lot of the issues with (eg) making sure that bnd’s javac.source matches Eclipse’s.

---

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [March 31, 2021, 7:02am UTC](https://bnd.discourse.group/t/what-is-the-purpose-of-javac-profile-switch/115/7 "2021-03-31T07:02:22Z")

</div>

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.
