Slovakia has already begun accepting migrants relocated from Greece, according to the Commission.
The court noted the small number of relocations so far is due to factors that the European Union could not have foreseen, including "the lack of co-operation on the part of certain member states".
"It is time to be united and show full solidarity", he added.
Article 78 (3) of the EU Treaty provides that 'in the event of one or more Member States being confronted by an emergency situation characterised by a sudden inflow of nationals of third countries, the Council, on a proposal from the Commission, may adopt provisional measures for the benefit of the Member State (s) concerned'.
"But we should be clear that member states have to show solidarity now because it is now that some member states need help".
#ECJ confirms our view on the migration scheme.
German Foreign Minister Sigmar Gabriel said he expects all European Union countries to implement the decision "without further hesitation".
At a press conference in Brussels after the ruling, Dimitris Avramopoulos, European Commissioner for migration, told reporters that states that continued to refuse compliance with the plan "in the coming weeks" would be referred to the European Court of Justice. "This decision jeopardises the security and future of all of Europe".
Kate Middelton and Prince William are expecting baby #3
A change in law after William and Kate Wednesday gave women the same rights of accession to the throne as men. The royal family is growing! Kate thanked the well-wisher for the present and turned to William.
The EU was accused of "raping" its own values after its top court ruled countries should be forced to accept refugees under a relocation scheme.
Under the plan, Hungary must admit more than 2,300 asylum seekers, while Slovakia must in the long term take in 1,400.
In Germany, where Chancellor Angela Merkel is fighting for re-election against opponents who criticise her for taking in over a million migrants at the height of the drama, the interior minister threatened legal action against countries which fail to take in their allotted share of Syrian and other refugees.
Since its introduction in September 2015, the quota system has fallen short of reaching its 120,000 target.
Hungary accused the Luxembourg court of making an "outrageous and irresponsible" politically driven decision.
Polish Prime Minister Beata Szydlo also rejected the ECJ's ruling, saying that Poland will hold firm to its position on asylum seekers and refugees.
Szijjarto said the decision was made based on political rather than legal or professional considerations.
EU lawmakers are welcoming a court ruling rejecting an appeal by Hungary and Slovakia against the European Union's flagship refugee-sharing scheme.
But Slovakian Prime Minister Robert Fico said he accepted the court's decision. "We will continue to work on having solidarity expressed in different ways other than forcing (on us) migrants from other countries that don't want to be here anyway". So far only 25,000 refugees have been moved.