Pack light, because porters can be hard to find and storage space in hotel rooms may be tiny. What you pack depends more on the time of year than on any dress code. For travel in the cities, pack as you would for any American or European city. At more expensive restaurants and nightclubs men usually need to wear a jacket and tie. Wear conservative-color clothing at business meetings. Casual clothes are fine for sightseeing. Jeans are as popular in Japan as they are in the United States, and are perfectly acceptable for informal dining and sightseeing.
Although there are no strict dress codes for visiting temples and shrines, you will be out of place in immodest outfits. For sightseeing leave sandals and open-toe shoes behind; you'll need sturdy walking shoes for the gravel pathways that surround temples and fill parks. Make sure to bring comfortable clothing to wear in traditional Japanese restaurants, where you may need to sit on tatami-matted floors. For beach and mountain resorts pack informal clothes for both day and evening wear. Central and southern Japan are hot and humid June to September, so pack cotton clothing. Winter daytime temperatures in northern Japan hover around freezing, so gloves and hats are necessary, and clip-on shoe spikes can be bought locally.
Japanese do not wear shoes in private homes or in any temples or traditional inns. Having shoes you can quickly slip in and out of is a decided advantage. Take wool socks (checking first for holes!) to help you through those shoeless occasions in winter.
All lodgings provide a thermos of hot water and bags of green tea in every room. For coffee you can call room service, buy very sweet coffee in a can from a vending machine, or purchase packets of instant coffee at local convenience stores. If you're staying in a Japanese inn, they probably won't have coffee.
Sunglasses, sunscreen lotions, and hats are readily available, and these days they're not much more expensive in Japan. It's a good idea to carry a couple of plastic bags to protect your camera and clothes during sudden cloudbursts.