"Something caused this battery pack to overheat, ignite," Donahue said, adding it's too soon to know the cause.
The flight landed normally at about 10:15 a.m. Its 173 passengers and 11 crew members had already gotten off the jet when a mechanic spotted light smoke in the cockpit and cabin about 15 minutes later and notified Massport.
"When we arrived, it was a heavy smoke, and that was in three minutes, so this was advancing," Donahue said.
One firefighter had skin irritation after contact with the chemical used to douse the fire, Donahue said.
The 787 is Boeing's newest plane, first was delivered in late 2011. In November 2010, a test flight had to make an emergency landing after an in-flight electrical fire. The fire delayed flight tests for several weeks while Boeing investigated. (Read More: Boeing's 787 Faces Scrutiny After Several Reports of Mishaps)
Last month, a United Airlines 787 flying from Houston to Newark, N.J., diverted to New Orleans because of an electrical problem with a power distribution panel. No one was injured.
The 787 uses two lithium ion batteries -- including one for the auxiliary power unit, according to a Boeing guide for firefighters dealing with the 787.
The rechargeable batteries, widely used in consumer devices, have some pilots worried because batteries being shipped as cargo are suspected to have caused or contributed to the severity of fires in cargo planes.
When Boeing proposed using the batteries in the 787, the Federal Aviation Administration issued special rules, including a requirement that they be designed to prevent overheating.
The FAA noted in its 2007 rule that, "In general, lithium ion batteries are significantly more susceptible to internal failures that can result in self-sustaining increases in temperature and pressure. ... The metallic lithium can ignite, resulting in a self-sustaining fire or explosion."
The severity of overheating is higher in larger batteries, the FAA said in the rule.
Boeing Co. spokeswoman Lori Gunter said the company was aware of the fire and was working with JAL. Boeing has delivered 49 787s, including seven to Japan Airlines. Another 799 have been ordered by airlines worldwide.