# Sub-bundles: -buildpath vs. -classpath

**URL:** https://bnd.discourse.group/t/sub-bundles-buildpath-vs-classpath/482
**Category:** GENERAL
**Created:** [October 24, 2024, 11:36am UTC](https://bnd.discourse.group/t/sub-bundles-buildpath-vs-classpath/482 "2024-10-24T11:36:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)
#### Post date: [October 24, 2024, 11:36am UTC](https://bnd.discourse.group/t/sub-bundles-buildpath-vs-classpath/482/1 "2024-10-24T11:36:09Z")

</div>

Hi Peter @pkriens , I am trying to following your hint to create a single wrapper bundle in my workspace using sub-bundles for each lib I want to wrap. (based on [this](https://bnd.discourse.group/t/generating-multiple-bundles-per-project/84))

I have the feeling `-buildpath` in a sub-bundle works different than in a normal bnd.bnd. In sub-bundle I had to use `-classpath` instead, to get same result.

Any pointers to why that is?

**Here more details:**

Before I had a separate wrapper bundle with a `bnd.bnd` and a `-buildpath` instruction:

```auto
-buildpath: \
	org.apache.poi:poi;version=latest,\

```

This basically extracted the dependency in my wrapper jar.

**But** in a sub-bundle `mysubbundle.bnd` the `-buildpath` seems to be ignored.  
I could only get the same result as before when I use `-classpath` like this:

```auto
-classpath: \
	${repo;org.apache.poi:poi;latest},\

```

my parent bnd.bnd is simple like this:

```auto
-resourceonly: true
-sub: *.bnd

```

---

<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: [October 28, 2024, 11:25am UTC](https://bnd.discourse.group/t/sub-bundles-buildpath-vs-classpath/482/2 "2024-10-28T11:25:05Z")

</div>

The -buildpath is a _project_ instruction. This means that it **must** be placed in the bnd.bnd file, not in the sub bnd file. A project can only have a single -buildpath.
