But Joshua did not draw back his hand with which he stretched out the javelin until he had devoted all the inhabitants of Ai to destruction.
Joshua 8:26 ESV

Joshua's javelin is reminiscent of Moses' staff. It was a symbol of the authority that God had given him. As long as he held that authority up and not his own, Israel would be victorious. The difference between Moses' staff and Joshua's javelin is that the former is a tool of peace, while the latter is a weapon of war. There's a place for both in God's kingdom.