Gather all of the ingredients you need and preheat your oven to 375F. You'll also need to grease an 8" baking tin.
Add the butter, sugar, flour, eggs baking powder and vanilla extract to a bowl. Mix well until you have a smooth batter.
Pour batter into your prepared baking pan and place your cake in your preheated oven for around 25 minutes. Remove from oven and leave to cool.
For the frosting, add the sugar, vanilla, butter and mix to a bowl and mix well until you have a light and fluffy buttercream.
Cut out circles of cake that fit the size of your mason jars and then cut them into 4 equal pieces, so you can place them back together again easily in the jar.
Add one layer of cake, then one layer of jam, then one layer of buttercream. Add your second layer of cake, a layer of jam and a final layer of buttercream. Seal the jar, and your cupcake in a jar is ready!