Flash
When Javelin of Lightning enters the battlefield, attach it to target creature you control.
As long as it's your turn, equipped creature gets +2/+0 and has first strike.
Equip {4} ({4}: Attach to target creature you control. Equip only as a sorcery.)
Attaching an Equipment with its enters-the-battlefield triggered ability isn't the same as using its equip ability. You don't pay mana for the attachment, and the timing restrictions for equip abilities don't apply.
If the target creature becomes an illegal target, the Equipment remains on the battlefield unattached.
Javelin of Lightning doesn't enter the battlefield attached to a creature. Instead, the Equipment enters the battlefield and then a triggered ability attaches it to a creature. You may cast Javelin of Lightning even if you don't control any creatures.