In a medium saucepan, heat oil over medium-low heat. Add onions and sauté until they soften and become translucent, about 10-15 minutes.
Mix in sugar and cook 2 minutes or until sugar has dissolved. Carefully add vinegar and wine (or juice). Increase the heat and bring to a boil. Reduce heat to a simmer and cook until the liquid has almost evaporated and onions are caramelized and completely tender, stirring frequently. This will take anywhere from 45 to 60 minutes. Watch the onions carefully so they don't burn.