Cavanilles was born in Valencia, Spain. He lived in Paris from 1777 to 1781, where he followed careers as a clergyman and a botanist. From Paris he moved to Madrid, and was director of the Botanic Garden and Professor of botany from 1801 to 1804. He died in Madrid in 1804.