Prosecutors said during the trials last year that the plant was among the largest ecstasy factories ever found in Southeast Asia, and recommended execution.
They said the factory in Serang, 60 km west of Jakarta, was capable of producing one million ecstasy pills, worth $11m a week.
The plant was raided by Indonesian police in late 2005.
"We decided to deliver the death penalty because it is related to international organised crime which is very dangerous," court spokesman Djoko Sarwoko said.
"If we let them be, they would be able to produce in another place, or teach others their skills. This is a threat to the next generation."
Capital punishment is common for serious drug offenders in Indonesia and foreigners have not been exempt.
Six Australians are on death row for trying to smuggle heroin out of the resort island of Bali into Australia.
The nine men sentenced in the latest case have one final legal option to appeal the ruling, but new evidence must be produced.
They can also seek a presidential pardon.