Javelins use Strength.
Basically, Strength is the ability you use for calculating hit/damage, unless otherwise specified. For example, the Monk can use their Strength, or Dexterity, as they see fit:
You can use Dexterity instead of Strength for the attack and damage rolls of your unarmed strikes and monk weapons.
Source
Or the finesse property, again allows you to use Strength, or Dex (the dagger, and darts have this property, for example):
Finesse. When making an attack with a finesse weapon, you use your choice of your Strength or Dexterity modifier for the attack and damage rolls. You must use the same modifier for both rolls.
Source
The important thing to differentiate is that Ranged weapons use Dex, and Thrown weapons use Strength (unless they have the "Finesse" property, as explained above).