TOKYO -- For years, U.S. automakers complained that they couldn't sell cars in Japan because of trade barriers. Now those barriers are largely gone but Detroit still can't sell many cars here because European competitors moved in faster and got a lock on this lucrative market.

Thanks to widespread prosperity and changing attitudes toward foreign goods, Japanese consumers are finally warming to foreign cars. Import sales have grown nearly 400 percent, to more than 200,000 cars per year over the past five years. Japanese government economists predict imports will go up another 50 percent by the mid-1990s.

But this boom has been a boon mainly to companies like Volkswagen, Mercedes and BMW. German companies have captured about 67 percent of the import market and other European countries have 20 percent among them.

U.S. manufacturers, slower than the Europeans to build dealer networks here and less aggressive in marketing, have about 10.6 percent of the foreign car business; and that figure includes about 5,000 Hondas produced in the United States and shipped to Japan for sale.

While Lee Iacocca, chairman of Chrysler Corp., has been the loudest of Detroit's leaders in criticizing Japan's trade practices, his company has done the least to enter the newly open market and is now struggling furiously to catch up.

The Germans' quick move into Japan, the world's second-largest auto market behind the United States, could pay dividends for years to come. In the past, the Japanese have shown extreme brand loyalty in cars. Some studies indicate that nearly 70 percent buy from the same company, and often the same salesman, every time they purchase a new car.

Industry sources predict that Japan will import some 240,000 cars this year. That's still a small portion of total auto sales. Imports amount to less than 4 percent of the market here; in the United States, in contrast, foreign cars have a market share of about 30 percent.

But even 4 percent of a market this rich is enough to draw automakers from around the world. The problem for U.S. automakers is that the Europeans saw the potential and acted on it before Detroit did.

"When BMW decided to set up its own dealership network here -- that was in ... 1981 or so -- everybody said they were crazy," recalled Henry Sampson of the American Chamber of Commerce in Japan. "They put a lot of money into this country. After a while, it really paid off."

"All the so-called government barriers {to auto imports} are more or less gone now," said a trade official at the U.S. Embassy here. "But I'm afraid the Germans got started faster than our companies did. They have been much more aggressive about selling to the Japanese."

The Europeans also were quicker than U.S. companies to adopt Japanese methods of selling cars. Through intense advertising and extended warranties, the European automakers are gradually overcoming the common Japanese conception that no car can meet the quality standard of the home-made models. And European automakers have worked to make foreign cars highly desirable status symbols.

The cars driven by private detectives and similar with-it types in movies and TV dramas these days tend to be flashy European sport cars or long, elegant BMW sedans. With magazines touting a "back to nature" trend here, the British four-wheel-drive Range Rover is perhaps the most fashionable car of the moment.

Japanese buyers eagerly sign waiting lists and then wait months for a chance to buy a $60,000 Mercedes.

College students decorate their tiny tatami-mat apartments -- the size of a walk-in closet in American homes -- with wall-sized posters of Alfa-Romeo convertibles and Porsche sedans.

In Japan, as in Britain, cars drive on the left side of the road, so the steering wheel is on the right. But foreign-car status is so important to upper-income Japanese yuppies that most imported cars -- even those built in Europe -- come with American-style left-side steering wheels. Most Rolls-Royce cars sold here now are left-side drive models, initially designed for the U.S. market.

The boomlet for imported cars stems from domestic events as well as the hard work of the foreign manufacturers.

The seemingly endless economic expansion, the strengthening of the yen and the increasing availability of auto loans have made more and more Japanese able to buy a car in the "luxury" class -- that is $25,000 or more.

Under intense pressure from its trading partners in North America and Europe, the Japanese government has changed laws and regulations to make it easier to buy an imported car. There are no more import duties on cars here and a 1986 tax revision eliminated a tax penalty that many foreign car buyers here had to pay.

Today, domestic and foreign automakers both predict imports could capture more than 10 percent of the world's second-biggest auto market by the end of the decade.

If present sales trends continue, though, that big chunk won't turn into big earnings for U.S. auto companies.