Two miles out from the centre of the city, though, there was hardly any electricity. Later I learnt there was a similar shortage of fresh water and waste disposal. After a couple of days of breathing smog, enduring traffic and shuttling from ministry to ministry, it was time to leave the capital and its problems behind. It was time finally to head to my real destination, Borobudur - the lost temple of Java.
The journey - in 1815 an arduous 400-mile, two-week slog for Thomas Stamford Raffles - took just an hour's flying time. I had flown to Yogyakarta, the cultural capital of Java, and Indonesia. The contrast with Jakarta was extraordinary. The air was crisp and clean. The traffic moved. There were buildings made, not of concrete and steel, but of wood. I loved it straight away. But I wasn't here for the city, I was here for the temple.
This little-known site in central Java is the largest Buddhist structure in the world: 1.6 million blocks of stone, three miles of exquisite reliefs and a dizzying location. The sales-pitch was convincing.
It was 4.15am. I left the hotel for the 45-minute drive through the dark, passing numerous souvenir shops - already opening their shutters. I still couldn't see the monument and began to wonder whether the tales of its size and majesty had been exaggerated.
Once inside, torch in hand, I made my way along a trail. Sunrise was 10 or 20 minutes away, and the sky was beginning to redden. I turned a corner and there it was, Borobudur, illuminated only by simple spotlights.
I hurried closer, feeling increasingly humble. My aim was to go straight to the top and watch the sunrise. I knew that this was not the way the temple was supposed to be used but, after all, I was a tourist. Even before Java's hot and humid day begins, the steep stairs demand a certain exertion. Deliberately trying not to look around, I climbed straight past the seven terraces to the central stupa (a Buddhist monument) and sat looking east.
This close to the equator, the days are regular - more or less 6am to 6pm - and at sunrise and sunset you can see the light changing from black to deep blue, to sky blue. Directly ahead of me to the east was Merapi volcano, one of the most active on Earth. Slowly its smoke could be seen outlined against the sky. The sun rose directly behind the mountain and, as the light spread, I could look around, with no one else in sight.
I felt as if I had landed in an entirely alien environment. Bell-shaped stupas, perforated and containing Buddhas, surrounded me. In front, one of the 72 stupas had been stripped of its outer casing, revealing the Buddha - serene in contemplation. The volcanic andesite from which it was made is relatively easy to work and not smooth and compact like marble. But the skill of the sculpture gave it a grace that was astonishing. For a thousand years, the 504 Buddhas on the temple have maintained their peaceful contemplation. It was impossible not to feel an enormous sense of calm.
The Buddhas sat, eyes closed, legs crossed, hands symbolically placed. Poised, elegant and humble. Who had built this temple? How had it been built? What had it been for? Why had it been abandoned? These were the questions that occupied Thomas Stamford Raffles, the man credited with its rediscovery.
I had been trying to take notes and record light changes on my small video camera but I had to keep stopping to simply observe the light changing on the stone. I had not realised that grey could contain so much variation. I saw orange, yellow, pale blue and green wash across the stone as the sun made its swift ascent, the temperature increased and the humidity closed in. The stones began to feel warm as if they too had had new life breathed into them. What could Raffles have thought when he saw this for the first time? Borobudur must have been staggering to this inquisitive employee of the British East India Company. And what must the original Buddhist pilgrims have thought, a thousand years ago, when they crossed the last mountain pass and saw the temple sitting in the volcanic plain before them? There was a building the size, shape and colour of which they would never have even dreamt. In a world of wooden buildings and green fields, Borobudur would have struck them as utterly extraordinary, if not alien - of another world, of the gods.
It appears that the temple was built by Javanese Buddhists, the first block laid down at around 780AD. Subsequent layers were added until, as some archaeologists believe, a formal representation of mandala, the Buddhist cosmology, was produced.
Gradually, Javanese civilisation moved away from this area - to trade and to avoid volcanic activity - and influences such as the introduction of Islam in the 15th and 16th centuries took hold. Borobodur was abandoned, to lie hidden by a covering of dense foliage for around 1,000 years.
Today the park's loud-speaker system announces the gates open at 6am. As I watched the first bus disgorged its load of Italian tourists, who began their ascent, chattering and laughing their way to the top. A group of elderly Indonesians appeared and rushed to touch a Buddha for luck. Then small groups of Indonesian youths arrived, and by 7am the top was awash with people and noise - cameras, cassette players, laughter. The sounds of the plain were equally audible - motorbikes, calls to prayer, children crying, loud music.
This was a living monument in a real world. Indeed it is Indonesia's most popular site and it sounded as if most of the country had chosen this morning to visit.
The author is producer of `The Lost Temple of Java', broadcast tonight on BBC2 at 8.15pm. A book, from which this article has been adapted, is also available, published by Orion at pounds 18.99
The only direct flights from the UK to Java are twice weekly from London Heathrow to Jakarta on British Airways (0345 222111). From there, cheap and frequent domestic flights are available.
Discounted fares on indirect flights are widely available through discount agents such as Trailfinders (0171-938 3366) and Travelbag (01420 80828). You can expect to pay around pounds 500 return.
No visas are required for short-term visits by British passport holders.
For the latest Foreign Office advice on Indonesia, contact the Travel Advice Unit on 0171-238 4503 or 4504; at http://www. fco.gov.uk/ or on BBC2 Ceefax from page 470 onwards.Reuse content