Yes. You automatically collect any thrown weapons after the encounter. You will probably want several of them just to make sure you can use them. I play a couple of heavy melee chars and they both carry about 5 javelins and have never run out.
Of interest, if you pick up a magic javelin you will only need one. Magic thrown weapons return after they are thrown.
Regarding moving and interacting with objects, the Player's Handbook states:
You can also interact with one object or feature of the environment for free, during either your move or your action. For example, you could open a door during your move as you stride toward a foe, or you could draw your weapon as part of the action of the same action you use to attack. If you want to interact with a second object, you need to use your action.
Also, in the Movement and Position section of the PHB (page 196) we have (edited to only show relevant points):
Interacting With Objects Around You
Here are a few examples of the sorts of thing you can do in tandem with
your movement and action:
- . . .
- draw or sheathe a sword
- . . .
- pick up a dropped axe
- . . .
Using the above quotes:
If I throw my Javelin at a enemy (regardless if it hits or miss and barring it falls off a cliff or something), can I still move in to retrieve it in combat?
Yes, I would definitely say picking up a spear/javelin on the ground counts as interacting with one object or feature of the environment.
If I do, what action does that take up? Also if I throw two, can I retrieve both?
Picking up the first one can be done for free as part of your move. Picking it up could even be done for free as part of an attack action with it!
However, if you want to retrieve the second one in the same turn, you would need to pick one up for free during your move, and then take the "Interact with an Object" action to grab the other.
Best Answer
You will have to make a house rule to determine this, as its not in the rules as written.
For weapons with the ammunition property, like arrows, there is a rule you could use as a guideline.
You could determine that this means that 50% of missiles are sticking out of enemies bodies, or fell to the ground nearby. The rest were lost or broken for one reason or another. An arrow hitting a tree will most likely break.
Weapons with the thrown property are different. The DM is responsible for determining what happens when this weapon damages you, or indeed misses; ask where it lands and whether you can reach it.
Regarding whether or not the weapon is literally sticking out of you, the DM could rely on the amount of damage dealt. If a javelin does 1 damage in total, you could say that it pokes through your armour but does not penetrate more than an inch, then falls to the ground.
If the javelin was thrown with +4 to its damage, and a 6 is rolled, you could instead say that it is in fact, stuck in you.
You could instead get some gloves of missile snaring, or be a monk, and just snatch the missile out of the air.