If canning, prepare a waterbath canner, jars and lids before beginning.
Prepare peaches (peel, pit, chop) and blueberries (wash or thaw).
In a large pot, combine peaches, blueberries, lemon juice, and water. Bring to a boil and simmer for 10 minutes.
Add sugar and salt, stirring to dissolve. Add spices in a cheesecloth bag (optional).
Boil rapidly, stirring constantly, until the jam thickens (9°F above the boiling point of water, or 220°F).
Ladle hot jam into sterilized jars, leaving ¼-inch headspace. Wipe rims and seal with lids.
Process in a boiling water canner for 10 minutes, or 15 minutes if above 6,000 feet in elevation.
Let cool, check seals, and store in a cool, dark place.