A palace statement quoted the king as telling Israeli President Isaac Herzog that it was necessary to work for peace so that "the Palestinians and the Israelis do not continue to pay the price".
The king said that Jordan "condemns violence in all of its forms" and that "every life matters", in reference to the attack on Tuesday.
The shooting occurred in Bnei Brak, an ultra-Orthodox city near Tel Aviv. Israeli media said a Palestinian man killed five men in their 30s and 40s.
Israeli Prime Minister Naftali Bennett said the country was facing a wave of terrorism after six people were killed in two earlier attacks, which were claimed by supporters of ISIS.
The Israeli president was in Jordan on a rare, announced visit to Amman. King Abdullah regularly meets Israeli officials, without announcing the meetings.
The royal palace gave out a photo of the two men shaking hands in front of the Jordanian and Israeli flags.
Mr Herzog said came to Jordan as people in Israel were burying the victims of the attacks in his country.
"We must fight together against any type of terror and cooperate for the benefit of the security of our nations," he said during the meeting with the king.
Jordan since the election of US President Joe Biden in November 2020 has sought to raise its profile in the Middle East, in particular in relation to the Israeli-Palestinian conflict.
It is an issue where Jordanian officials regard the kingdom as having been sidelined during the Donald Trump presidency.
Relations between Israel and Jordan deteriorated during the 11-day war in May last year between Israel and Hamas, with Amman accusing the Israelis of unjustified repression of the Palestinians in the months leading to the war.
The king later in the year met senior Israeli officials and the two countries struck a barter agreement that would see Israel provide Jordan with water in return for electricity from a proposed solar power plant.
But Jordan was absent from a meeting in Negev, Israel, this week between senior ministers from the UAE, Israel, Bahrain, Morocco, Egypt and the US.
The focus of the meeting was building up deterrence against Iran.
A Jordanian official said on condition of anonymity that Jordan was invited but chose not to attend. He indicated that it was not in the kingdom's interest to attend the meeting, without elaborating.