1. Put all the ingredients into a large heavy based pan and bring to the boil. Stir often to help the sugar melt.
2. Turn down the heat so the compote is on a light rolling boil, and cook for 5 minutes before removing the star anise (if using). This will give enough of a background flavour, but if you love the flavour of this spice you can keep it in there until the end. I find it overpowers the delicate flavour of the cherries and prefer to remove it.
3. Gently cook the compote for 15 more minutes, until most of the liquid has reduced and most of the cherries have broken. Make sure around half of the cherries are submerged in juice.
4. In the meantime sterilise your preserving jar. Wash in warm soapy water and pop in a cold oven set to 150°C/300°F/gas 2 for 10 minutes to dry out. Or run them through a hot wash in the dishwasher.
5. When the compote is ready, carefully pour into the hot sterilised jar, seal immediately, and leave to cool. The compote will last about 6 months but always check the lid to see if anything unsavoury is growing on there. If there is then check the compote before eating.