Heat the olive oil in a heavy-bottomed pan. Add the onions and sauté them for about 10 minutes, until soft. Stir in the garlic, rosemary, and juniper berries and sauté them for a minute. Add as much cabbage as will fit in the pan and cook while stirring until it wilts. Then add more cabbage.
Add the cinnamon, sugar, and vinegar, cook for a while, then douse with the stock. Cover the pan and let simmer over low heat for about 45 minutes.
Add the pear cubes about 15 minutes before the end of the cooking time. Season with salt and pepper. Let cool.
Heat up the cabbage in the same pan, stirring continuously, or just leave it at room temperature. Garnish with some extra rosemary leaves and the hazelnuts, and drizzle with a splash of hazelnut oil.