Hello and thank you for submitting your question to Ask an Expert - a FREE service of Oregon State University Extension!
It is fine to add whole spices to your canned juice without it affecting the safety of the product. For fruit juice, it should be processed in a boiling water canner for 10 minutes if using pint or quart jars and 15 minutes if using 1/2 gallon jars. The heating in the boiling water canner will pasteurize the juice and spices and seal the jars so that they can be stored safely at room temperature. See our publication on Canning Fruits for more information. Let me know if you have any other questions.