Asked by HuffPost UK if he would work for Johnson, he said: “I would serve under anyone that was elected by the members. I believe in the Conservative Party.”
Asked if he would run as a leadership candidate himself, he said: “You have had your one question.”
But, in comments that could be interpreted as an attack on Johnson, Javid told Tory activists: “Let’s also not become like some other countries, certainly some in Europe, some further afield, that have started appealing to naked populism with no real purpose other than to gather up as many votes as they can, preaching to people’s fears.
“Let’s not preach to people’s fears. Let’s preach to their hopes. Let’s not base policy on raw emotion, let’s base it on evidence. If we take this kind of approach then we are well on the way to wining the next election.”
Speaking at a separate event, Javid warned Tory members they should be prepared for Jeremy Corbyn to become prime minister.
“We have a hard-Left Opposition. Which, truth be told, has a real chance of winning power. We can not let that happen,” he said.
“If we are going to stop that then we have to have the right ideas,” the home secretary said.
At an event billed as promoting a “new generation” of Tory activists, He added: “As well as the ideas, we also need the people.
“Ideas on their own are no good without the people that can propagate those ideas and put them into public policy.”
Javid praised the “talent” of Tory MPs elected in 2010, 2015 and 2017 - the support of whom he will require to take the top job - as well as as young party officials who serve as advisers to ministers and MPs.
It came as allies of Boris Johnson issued an ominous warning to Theresa May to ditch her Chequers Brexit plan or face serious backbench unrest.