
14 So.3d 121 (2009)
ALABAMA DEPARTMENT OF PUBLIC SAFETY and Mike Coppage, as director of the Alabama Department of Public Safety
v.
Greg OGLES.
1061539.
Supreme Court of Alabama.
January 16, 2009.
Jack W. Curtis and J. Haran Lowe, Jr., Department of Public Safety, Legal Unit, for appellants.
Brian M. Clark of Wiggins, Childs, Quinn & Pantazis, LLC, Birmingham; and *122 Gary B. Holder of The Holder Law Firm, Homewood, for appellee.
BOLIN, Justice.
The issue in this case is whether the court in which the underlying action was filed, the Jefferson Circuit Court, had subject-matter jurisdiction over the original complaint. We conclude that it did not.

Facts and Procedural History
On February 25, 2005, Greg Ogles filed a class action in the Jefferson Circuit Court claiming that members of the purported class had been overcharged for duplicate or renewed driver's licenses by the Alabama Department of Public Safety ("the Department"). The complaint sought declaratory and injunctive relief and a refund of the alleged overpayments. The Department, which was listed on the complaint as the only defendant, filed a motion to dismiss the complaint, claiming, among other things, sovereign immunity and asserting that venue in Jefferson County was improper. In opposition to the Department's motion to dismiss, Ogles amended his complaint to name Mike Coppage, in his official capacity as director of the Department, as a defendant.[1] On May 4, 2005, the Jefferson Circuit Court denied the Department's motion to dismiss but apparently agreed with the Department that venue in Jefferson County was improper. On July 8, 2005, the case was transferred to the Montgomery Circuit Court. On December 14, 2005, the Department and the director filed a motion asking the Montgomery Circuit Court to reconsider the Jefferson Circuit Court's order denying the motion to dismiss, again asserting sovereign immunity as a basis for dismissal. On May 11, 2005, the Montgomery Circuit Court entered an order reserving its ruling on the Department's assertion of sovereign immunity. The court allowed Ogles to proceed with discovery on his individual claims (as opposed to any discovery related to the class action), limited to the issue whether the Department was charging more than is statutorily allowed for the issuance of duplicate or renewed driver's licenses.
On August 18, 2006, the Department and its director filed a motion for a summary judgment that, among other things, involved the doctrine of sovereign immunity. On August 31, 2006, Ogles filed a motion in opposition to the Department and the director's summary-judgment motion, along with a motion for a summary judgment on his individual claims. On June 12, 2007, the Montgomery Circuit Court entered an order denying the Department and the director's motion for a summary judgment and entering a summary judgment in favor of Ogles, finding that Ogles had been overcharged for his duplicate driver's license. The court stated that the class allegations remained pending. The court made the summary judgment for Ogle on his individual claims final pursuant to Rule 54(b), Ala. R. Civ. P. On July 19, 2007, the Department and its director appealed, raising the following issues for appellate review:
"I. Whether the trial court erred in finding that Greg Ogles was overcharged $1.36 for a driver's license by the Alabama Department of Public Safety.
"II. Whether under Article I, § 14 of the Constitution of Alabama of 1901, Greg Ogles is precluded in this action from recovering from the Alabama Department of Public Safety an alleged $1.36 overcharge for a driver's license."
*123 While the appeal was pending, the Montgomery Circuit Court purported to consolidate this case with a class action pending in that court against the Department and its director that involved the same issue, and the court allowed the parties in the consolidated cases to proceed with class-related discovery.

Discussion
In Ex parte Alabama Department of Transportation, 978 So.2d 17 (Ala.2007) ("Good Hope"), Good Hope Contracting Company ("the company") sued the Alabama Department of Transportation ("ALDOT"), seeking declaratory relief, damages for breach of contract, and a writ of mandamus directing ALDOT to pay for roadway-construction projects the company had allegedly completed for ALDOT. ALDOT filed a motion to dismiss the complaint on the ground that ALDOT, as a State agency, is entitled to sovereign immunity under § 14, Ala. Const.1901. The trial court did not rule on the motion. Subsequently, ALDOT petitioned this Court for a writ of mandamus. In response to the petition, the company asked this Court to direct the trial judge "to allow [the company] to amend its complaint to add the proper party." 978 So.2d at 25.
In regard to suing a State agency, this Court in Good Hope stated:
"This Court has long held that `"`the circuit court is without jurisdiction to entertain a suit against the State because of Sec. 14 of the Constitution.'"' Larkins v. Department of Mental Health & Mental Retardation, 806 So.2d 358, 364 (Ala.2001) (quoting Alabama State Docks Terminal Ry. v. Lyles, 797 So.2d 432, 435 (Ala.2001), quoting in turn Aland v. Graham, 287 Ala. 226, 229, 250 So.2d 677, 678 (1971)). `[A]n action contrary to the State's immunity is an action over which the courts of this State lack subject-matter jurisdiction.'
"....
"This Court has repeatedly held that § 14, Ala. Const.1901, `affords the State and its agencies an "absolute" immunity from suit in any court.' Haley v. Barbour County, 885 So.2d 783, 788 (Ala. 2004); see also Ex parte Mobile County Dep't of Human Res., 815 So.2d 527, 530 (Ala.2001) (`Pursuant to § 14, Ala. Const. of 1901, the State of Alabama and its agencies have absolute immunity from suit in any court.'); Ex parte Tuscaloosa County, 796 So.2d 1100, 1103 (Ala.2000) (`Under Ala. Const. of 1901, § 14, the State of Alabama has absolute immunity from lawsuits. This absolute immunity extends to arms or agencies of the state....'). This absolute immunity from suit also bars suits for relief by way of mandamus or injunction. Ex parte Troy Univ., 961 So.2d 105, 110 (Ala.2006)."
Good Hope, 978 So.2d at 21-22.
This Court in Good Hope also refused to allow the company to amend its complaint to add the proper party, stating:
"ALDOT argued in its motion to dismiss that, as a State agency, it was not the proper party to be sued, and it pointed out that [the company] had failed to name any State official as a party. ALDOT's supplemental submission and brief in support of motion to dismiss, tab 3 at 8.
"Further, in Ex parte Blankenship, 893 So.2d 303, 306-07 (Ala.2004), this Court held that, if a trial court lacks subject-matter jurisdiction, it has no power to take any action other than to dismiss the complaint. A trial court lacks subject-matter jurisdiction if the defendant is immune under the doctrine of sovereign immunity. Larkins, 806 So.2d at 364 ("`Article I, § 14, of the *124 Alabama Constitution of 1901 thus removes subject-matter jurisdiction from the courts when an action is determined to be one against the State.'" (quoting [Alabama State Docks Terminal Ry. v.] Lyles, 797 So.2d [432] at 435 [(Ala. 2001)])). Thus, this Court cannot order the trial court to allow [the company] to amend its complaint because the trial court lacks subject-matter jurisdiction."
Good Hope, 978 So.2d at 26.
In Ex parte Alabama Department of Transportation, 990 So.2d 366 (Ala.2008) ("Jones Brothers"), Jones Brothers, Inc., entered into a contract with ALDOT to construct a bridge. Jones Brothers subcontracted certain work to an electrical and lighting company. ALDOT eventually rejected some of the work performed by Jones Brothers and its subcontractor. Jones Brothers, the subcontractor, and the subcontractor's insurer then sued ALDOT, alleging, among other things, breach of contract. ALDOT moved to dismiss the action based on the doctrine of sovereign immunity, and it cited to Good Hope, supra. The trial court denied the motion and purported to order the plaintiffs to amend their complaint to name proper parties. ALDOT petitioned this Court for mandamus relief. This Court held that because ALDOT was the only named defendant and no State official had been named by the plaintiffs, the action was due to be dismissed on the basis that § 14 deprives the trial court of jurisdiction to entertain the action against ALDOT.
This Court subsequently issued Ex parte Alabama Department of Transportation, 6 So.3d 1126 (Ala.2008) ("Russell Petroleum"), in which we held that ALDOT had absolute immunity from suit and, therefore, that the trial court lacked subject-matter jurisdiction to entertain an amendment to the original complaint. Russell Petroleum sued ALDOT seeking compensation for ALDOT's alleged "inverse condemnation" of Russell Petroleum's property. ALDOT moved to dismiss the complaint on the ground that the action was barred by Ala. Const.1901, § 14 ("the State shall never be made a defendant in any court of law or equity"). Subsequently, Russell Petroleum filed a motion seeking to "substitute (or add)" the director of ALDOT as a defendant. Russell Petroleum also filed an amended complaint that included the director in the style of the complaint and that sought declaratory relief along with money damages to compensate Russell Petroleum for the alleged inverse condemnation. ALDOT and its director filed a motion to dismiss, relying on Good Hope and arguing that the trial court did not have jurisdiction over them because the amended complaint was a nullity and arguing further that the trial court had no alternative but to dismiss the action. ALDOT and its director argued that the original complaint, which named only ALDOT, failed to invoke the subject-matter jurisdiction of the trial court because ALDOT was absolutely immune from suit, and that the amended complaint, which purported to amend a complaint that was void ab initio, was a nullity and, therefore, that no jurisdiction attached as a result of the amendment. The trial court denied the motion, and ALDOT petitioned this Court for a writ of mandamus. Relying on Good Hope, supra, and Jones Brothers, supra, this Court held that the trial court lacked subject-matter jurisdiction to entertain an amendment to the original complaint, which was filed solely against ALDOT, because the trial court never had subject-matter jurisdiction. We granted the petition and ordered that the action be dismissed.
In Alabama Department of Corrections v. Montgomery County Commission, 11 *125 So.3d 189 (Ala.2008) ("Montgomery County Commission"), the Montgomery County Commission sued the Department of Corrections ("the DOC"), alleging that the DOC was responsible for paying for the medical treatment of an inmate who had been confined at the Montgomery County detention facility. The DOC filed an answer denying the material allegations in the complaint. The Commission filed a motion for a summary judgment, which the trial court denied. Subsequently, the Commission filed an amended complaint in which it purported to add the commissioner of the DOC as a defendant in his official capacity, seeking to require the commissioner to perform his legal duty and to reimburse the Commission for its payments for the inmate's medical care. The DOC and the Commission each moved for a summary judgment. The trial court granted the Commission's summary-judgment motion and entered a judgment in its favor. The DOC and the commissioner appealed.
This Court issued an opinion in Montgomery County Commission on June 27, 2008, affirming in part, reversing in part, and dismissing the appeal in part, and, when no application for rehearing was filed, we issued a certificate of judgment. However, we then recalled the certificate of judgment and placed the case on rehearing ex mero motu. In so doing, we directed the parties to address the issue whether the Montgomery Circuit Court had subject-matter jurisdiction to allow the amendment of the complaint to add the commissioner of the DOC as a defendant. In our opinion on rehearing ex mero motu, issued on December 12, 2008, we held that Russell Petroleum and Good Hope controlled and that because the DOC is a State agency and had absolute immunity from suit, the original complaint, which named only a party that was absolutely immune from liability, failed to trigger the subject-matter jurisdiction of the trial court. We further held that because the original complaint was a nullity, the purported amendment of that complaint was also a nullity. In its response to our request for arguments from the parties, the Commission attempted to distinguish Good Hope by arguing that Good Hope also included a breach-of-contract claim, while the Commission was asking us to construe a statute, which is one of the exceptions to the doctrine of sovereign immunity. This Court noted that although some prior caselaw had used language indicating that a State agency can be a defendant under the exceptions to the doctrine of sovereign immunity, careless language is never a justification for ignoring the clearly expressed mandate of the Constitution. It is well established that the State and its agencies have absolute immunity from suit under § 14, not simply immunity from certain claims. The exceptions to the doctrine of sovereign immunity are relevant only as they relate to claims against State officials in their official capacities, not as they relate to the State agency or the State itself. 11 So.3d at 193.
In the present case, the original class-action complaint filed on February 25, 2005, listed the Department as the sole defendant. The Department and its director argue that the Jefferson Circuit Court lacked subject-matter jurisdiction over the original complaint, that it consequently could not entertain the amended complaint naming as a defendant Coppage in his official capacity as the director, and, therefore, that the appeal should be dismissed.
Ogles argues that the exceptions to the State's absolute immunity are not limited to officers of a State agency and that a State agency can be a defendant to a legal action. In support of his position, Ogles cites State Board of Education v. *126 McClain, 810 So.2d 763 (Ala.Civ.App. 2000). However, this Court reversed the Court of Civil Appeals' judgment in Ex parte Board of Education, 810 So.2d 773 (Ala.2001), in which this Court held that the State Board of Education was immune from suit under § 14. Moreover, this Court recently held that only State officers named in their official capacity  and not State agencies  may be defendants in declaratory-judgment actions. Alabama Dep't of Transp. v. Harbert Int'l, Inc., 990 So.2d 831 (Ala.2008); see also Montgomery County Commission.
We agree with the Department that because the original complaint named as a defendant solely the Department the Jefferson Circuit Court lacked subject-matter jurisdiction. On the authority of Good Hope, Jones Brothers, Russell Petroleum, and Montgomery County Commission, we conclude that the Jefferson Circuit Court thus lacked subject-matter jurisdiction to entertain the amendment to the complaint and to transfer the case to the Montgomery Circuit Court. Additionally, we note that the Montgomery Circuit Court likewise lacked jurisdiction over the case, including the jurisdiction to consolidate the case with any other pending action. "Where `the trial court ha[s] no subject-matter jurisdiction, [it has] no alternative but to dismiss the action.'" Gulf Beach Hotel, Inc. v. State ex rel. Whetstone, 935 So.2d 1177, 1182 (Ala.2006) (quoting State v. Property at 2018 Rainbow Drive, 740 So.2d 1025, 1029 (Ala.1999)). The judgment appealed from is vacated, and the action is ordered dismissed. Moreover, a void judgment will not support an appeal. Faith Props., LLC v. First Commercial Bank, 988 So.2d 485, 492 (Ala.2008). Therefore, the appeal is likewise dismissed.
JUDGMENT VACATED; CASE DISMISSED; APPEAL DISMISSED.
SEE, LYONS, WOODALL, STUART, SMITH, and PARKER, JJ., concur.
COBB, C.J., and MURDOCK, J., dissent.
MURDOCK, Justice (dissenting).
For the reasons explained in my special writings in Cadle Co. v. Shabani, 4 So.3d 460, 463 (Ala.2008) (Murdock, J., dissenting), and Ex parte Alabama Dep't of Transp., 6 So.3d 1126, 1128 (Ala.2008) (Murdock, J., dissenting), I respectfully dissent. See also Alabama Dep't of Corr. v. Montgomery County Comm'n, 11 So.3d 189, 194 (Ala.2008) (Murdock, J., dissenting).
COBB, C.J., concurs.
NOTES
[1]  While this litigation was pending, Coppage retired and Christopher Murphy was appointed as the director of the Department. Upon his appointment, Murphy was automatically substituted for Coppage as a party in this action pursuant to Rule 25(d), Ala. R. Civ. P.
