
92 N.J. 374 (1983)
456 A.2d 511
STATE OF NEW JERSEY, PLAINTIFF-RESPONDENT,
v.
DANIEL GAFFEY, DEFENDANT-APPELLANT.
The Supreme Court of New Jersey.
Argued September 28, 1982.
Decided January 27, 1983.
*379 Lois De Julio, First Assistant Deputy Public Defender, argued the cause for appellant (Joseph H. Rodriguez, Public Defender, attorney).
Lawrence H. Posner, Assistant Prosecutor, argued the cause for respondent (Harold J. Ruvoldt, Jr., Hudson County Prosecutor, attorney).
The opinion of the Court was delivered by HANDLER, J.
The New Jersey Code of Criminal Justice provides for the dismissal of criminal charges against a defendant who has been adjudged incompetent where either the defendant has remained unfit to stand trial for a sufficient period of time (N.J.S.A. 2C:4-6c), or it is "not substantially probable that the defendant will regain his competence in the foreseeable future" (N.J.S.A. 2C:4-6e). In this case, the defendant Daniel Gaffey was charged with various crimes involving an arson which resulted in the deaths of several persons. These criminal charges were dismissed pursuant to N.J.S.A. 2C:4-6 because of defendant's incompetence. The issue presented on this appeal is whether the dismissal is with or without prejudice.
The crimes attributed to Gaffey occurred on April 20, 1977 when he assertedly set fire to a building. Two days following the commission of the crimes, Gaffey, who was then in the military service, was hospitalized for psychiatric illness at Fort Dix, New Jersey. A week later he was transferred to a military hospital at Fort Gordon, Georgia, where a medical board diagnosed Gaffey as an acute paranoid schizophrenic, declared him unfit for further military duty and ordered him discharged. On June 6, 1977 defendant entered the Veterans' Administration *380 Hospital in Lyons, New Jersey. He was indicted on June 6, 1978 for murder, murder by arson, arson and related crimes.
By order dated March 19, 1979, almost two years after the commission of the crimes, the trial court had defendant transferred to the Trenton State Psychiatric Facility for evaluation. On November 14, 1979 the defense moved for an order pursuant to N.J.S.A. 2C:4-6 declaring Gaffey incompetent to stand trial and dismissing the indictment. After hearing expert psychiatric testimony from the defense and the State, the court by order dated November 21, 1979 declared defendant incompetent to stand trial and committed defendant to the Trenton Psychiatric Hospital but denied his request for dismissal of the indictment. It also ordered a further hearing in six months as provided in N.J.S.A. 2C:4-6c.
On February 15, 1980 defendant again moved for dismissal of the indictment. A hearing on the motion was held on April 2, 1980, at which time the court received further expert testimony on defendant's psychiatric condition. The trial court, applying the standard of N.J.S.A. 2C:4-6e, rendered an opinion on May 6, 1980 determining that there was no substantial probability that defendant would regain his competence in the foreseeable future. It issued an order on June 11, 1980 dismissing the indictment and civilly committing defendant to the Trenton Psychiatric Hospital. The court's order did not specify whether it had dismissed the indictment with prejudice or without prejudice.
On August 4, 1980 the State filed an appeal from the trial court's order dismissing the indictment. In its initial brief to the Appellate Division the State argued that the trial court had dismissed the indictment prematurely, that it had improperly evaluated and misapplied the expert testimony, and that judicial determination of the probability for defendant's recovery should have been postponed so that defendant's progress could be observed. During oral argument in the Appellate Division, the court raised the issue of whether the dismissal was with or without prejudice. The court granted leave for submission of *381 supplemental briefs on that issue. In lieu of a supplemental brief, the State submitted a letter advising the court that the most recent medical reports on Gaffey indicated a substantial deterioration in defendant's condition. The letter continued: "It is now clear to and accepted by the prosecution that Daniel Gaffey is not competent to proceed to trial and that there is no reasonable probability that he might be restored to competency within the foreseeable future." Further, the State requested permission to withdraw its appeal. The defendant submitted a supplemental letter brief contending that the dismissal should be with prejudice and requesting that the court adjudicate the merits of the appeal.
The Appellate Division in an unreported opinion refused to allow the State to withdraw its appeal and affirmed the trial court's order on the merits, holding that dismissal of the indictment "represented a sound exercise of the discretion of the trial judge...." The court, however, declined to adjudicate whether the dismissal was with or without prejudice on grounds that the question was not ripe for resolution and should await future developments relating to defendant's competency and possible reindictment. The court also modified the trial court's order so as to direct that the prosecutor be given prior notice of all periodic review hearings of defendant's civil commitment pursuant to R. 4:74-7.
Defendant petitioned for certification on the single issue of whether a dismissal of an indictment pursuant to N.J.S.A. 2C:4-6 is with prejudice. The State filed no cross-petition, but argued in its letter brief in opposition to defendant's petition that certification should be denied because the issue was not ripe for adjudication. The Court granted certification on December 22, 1981. 89 N.J. 390.

I
We deal first with a threshold issue. As noted, the State unsuccessfully sought to withdraw its appeal before the Appellate *382 Division and avoid an adjudication of the merits. Because the State continues to assert that it was entitled to withdraw its appeal, we proceed to this point.
The New Jersey Court Rules do not give appellants the right unilaterally to withdraw their appeals. R. 2:8-2 requires court approval of the withdrawal of an appeal in class actions and in actions involving the status of minors and otherwise grants parties the right to dismiss an appeal upon mutual consent. However, the rules do not grant a party an unqualified right to dismiss or withdraw his appeal without the consent of his adversaries.
Indeed, as a general proposition, an appellant does not possess an absolute right to withdraw his appeal. See United States v. Minnesota & Northwestern R. Co., 59 U.S. (18 How.) 241, 15 L.Ed. 347 (1855); Greenville Banking & Trust Co. v. Selcow, 25 F.2d 78, 80 (3 Cir., 1928). See also 5 C.J.S., Appeal & Error, § 1351 at 400. It has been recognized that an appeal can be withdrawn only with the consent of the court. Camden Sec. Co. v. Azoff, 112 N.J. Eq. 270, 278 (E. & A. 1932); State v. Tenenbaum, 151 N.J. Super. 273, 279 (App.Div. 1977). See also 5 C.J.S. Appeal & Error, at 400; 5 Am.Jur.2d Appeal & Error § 920 at 350-51. Nevertheless, a court will ordinarily permit an appeal to be voluntarily dismissed, unless prejudice to the appellee will result. State v. Tenenbaum, at 279; Greenville Banking & Trust Co. v. Selcow, at 80. See also 5 C.J.S. Appeal & Error § 1350 at 397-98, 399; 5 Am.Jur.2d Appeal & Error § 920 at 351.
In the context of the administration of criminal justice, the ability of the State to withdraw an appeal is not unrestricted. Although the enforcement of the criminal laws is ordinarily the primary responsibility of the executive, the courts have a supervisory authority with respect to the proper discharge of these responsibilities in the public interest. See, e.g., State v. Leonardis, 73 N.J. 360 (1977); State v. Leonardis, 71 N.J. 85 (1976); In re Investigation Regarding Ringwood Fact Finding *383 Comm., 65 N.J. 512, 519-20 (1974). This extends to the continued maintenance of criminal charges. Once a grand jury has indicted a defendant, the prosecutor may not enter a nolle prosequi of the charges without the permission of the court. State v. Kavanaugh, 52 N.J. 7, 21 (1968); State v. Ashby, 43 N.J. 273, 276 (1964). This supervisory authority to require the continuation of criminal proceedings would be incomplete and ineffective if it were not available to the courts at any time and at any court level during the pendency of a criminal case. The withdrawal of an appeal in a criminal matter, which may prejudice a defendant, is necessarily subject to judicial supervision and control. Thus, courts can require the State to maintain its appeal when the rights of the defendant may be prejudiced.
In this case, withdrawal of the appeal would leave in place the dismissal of the indictment without resolution of its permanency or finality. The defendant's rights would remain unsettled by a withdrawal of the appeal without definitive resolution of the meritorious issue. Under such circumstances we are satisfied that in the exercise of a sound discretion the Appellate Division properly denied the State leave to withdraw its appeal. Nevertheless, the Appellate Division concluded somewhat inconsistently with its decision to continue the appeal, that a decision as to whether the dismissal entered in this case is with or without prejudice should be postponed on grounds of unripeness. However, in our view, the interests of the defendant, as well as the State and the public, are sufficiently implicated at this time to warrant a resolution of the merits.

II
The meritorious issue in this case is whether under the New Jersey Code of Criminal Justice a criminal indictment can be dismissed with prejudice on grounds relating to the mental incompetence of the defendant, and, if so, the standards that govern whether such a dismissal should be with or without prejudice.
*384 It has long been recognized that the judiciary has the inherent power to dismiss criminal charges, particularly where the prosecution of charges would violate the defendant's constitutional rights. E.g., State v. Tropea, 78 N.J. 309 (1978); State v. Gregory, 66 N.J. 510 (1975); State v. Coolack, 43 N.J. 14 (1964). The New Jersey Code of Criminal Justice now expressly provides a procedure authorizing the judicial dismissal of indictments on grounds of mental incompetence.
There are two operative Code provisions involved in this appeal with respect to this dismissal authority. N.J.S.A. 2C:4-6c reads in part:
If the defendant has not regained his fitness to proceed within such time as the court may deem adequate from the time that it was determined that the defendant lacked such fitness, the court shall .. . dismiss the charges and either order the defendant discharged, or, subject to law governing civil commitment, order the defendant committed to an appropriate institution. When the charges are not dismissed, each defendant's case shall be specifically reviewed by the court at 6-month intervals until an order is made by the court that the defendant stand trial or that the charges be dismissed.
The other provision, N.J.S.A. 2C:4-6e states:
... If it is determined that it is not substantially probable that the defendant will regain his competence in the foreseeable future, the court may dismiss the charge and either order the defendant to be discharged, or, subject to the law governing the civil commitment, order the defendant committed to an appropriate institution.
The dismissal of the indictment in this case implicates each of these provisions. The initial motion to dismiss appears to have been brought and determined under N.J.S.A. 2C:4-6c. The dismissal that was eventually ordered by the trial court, becoming the basis for the State's appeal, involved N.J.S.A. 2C:4-6e.
The legislative history strongly indicates an intent that dismissals on grounds of incompetency under N.J.S.A. 2C:4-6c shall be with prejudice. The initial proposed version of N.J.S.A. 2C:4-6c paralleled the approach of the Model Penal Code. That proposal stated:
c. If after the defendant was committed because he lacked fitness to proceed and the Court is of the view that so much time has elapsed since the commitment that it would be unjust to resume the criminal proceedings, the Court may dismiss the charges and may order the defendant to be discharged, or, subject to *385 the law governing the civil commitment of persons suffering from mental disease or defect, order the defendant to be committed to an appropriate institution. [Proposed N.J.S.A. 2C:4-6(c), I New Jersey Penal Code: Report of the New Jersey Criminal Law Revision Commission 38 (1971) (emphasis added)]
The purpose of this provision, as explained in the Commentary of the Criminal Law Revision Commission, was to ensure that the judiciary had the power to dismiss with finality indictments against an incompetent defendant where reinstatement of the charges or the renewal of a criminal prosecution would be unjust.
... This [proposed N.J.S.A. 2C:4-6] is said to be "novel American law but not in actual practice, except that the result is usually reached ... through the entry of a nolle prosequi." MPC T.D. 4, p. 197 (1955). There is value, however, in vesting the power in the Court to dismiss where lapse of time caused actual prejudice or because due to the length of time spent in a mental institution, trial and punishment of the defendant would be unjust. [II New Jersey Penal Code: Final Report of the New Jersey Criminal Law Revision Commission 105]
The 1978 draft legislation altered the language of the proposed statutory dismissal authority and set a 12-month period after which a dismissal could be entered based upon a defendant's continuing lack of fitness. The Attorney General and the New Jersey Prosecutors' Association both assumed that the proposed statute provided for dismissals with prejudice. They strongly objected to the 12-month time limit contained in this draft because the time period was considered too brief to generate "actual prejudice" or demonstrable injustice to a defendant sufficient to warrant a final dismissal of criminal proceedings. Apparently in response to these views, the Legislature deleted the 12-month time limit and substituted "such time as the court may deem adequate." See In re Wiretap Communication, 76 N.J. 255, 267 (1978) (provisions in amendment of wiretap statute addressed specific objections made by the telephone company).
The consistent thread in this historical development of N.J.S.A. 2C:4-6c is the perceived correlation between the passage of time and the imputation of prejudice and injustice to an incompetent and institutionalized defendant. The clear implication is that the standard of an "adequate" time, as provided in the final draft and in the current enactment, would be the *386 length of time in which actual prejudice or injustice would otherwise ensue if the criminal prosecution were permitted to proceed and punishment ultimately imposed. The further implication is that a dismissal of criminal charges authorized under such circumstances would be with prejudice.
This history, which evinces a legislative intent to provide for dismissals with prejudice under N.J.S.A. 2C:4-6c, does not dictate a similar conclusion with respect to the variant provision of N.J.S.A. 2C:4-6e. This section has no parallel in the Model Penal Code; instead, it tracks the language of the Supreme Court's holding in Jackson v. Indiana, 406 U.S. 715, 738, 92 S.Ct. 1845, 1858, 32 L.Ed.2d 435, 451 (1972). The section permits dismissal of charges against an incompetent defendant when the judge determines that it is not substantially probable that the defendant will regain competence in the foreseeable future.
There is a fundamental distinction between determinations under section (e) and section (c) of N.J.S.A. 2C:4-6. The critical determination to be made under section (c), in addition to the continuing unfitness of defendant, is whether that period of time is "adequate" to justify a dismissal of the criminal charges. Under this statutory standard, the judge is called upon to examine the duration of this continued incompetency, the extent of the delay in bringing pending criminal charges to trial, the effects of the delay upon the prosecution and upon the defense, and the nature and length of defendant's institutionalization. Only when the factors considered in this deliberative process militate sufficiently against the continuation of the criminal prosecution is a dismissal warranted. Because these factors are not prone to ameliorative change, this outcome ought not to be reversible once resolved in favor of a dismissal. Thus, the dismissal of an indictment properly entered under N.J.S.A. 2C:4-6c must be with prejudice.
In contrast, a section (e) dismissal is purely prognostication. There is no requirement for the passage of any time before a dismissal motion under section (e) can be brought. A *387 ruling is based only on one factor  the likelihood of recovery. As a prediction, a section (e) dismissal may simply turn out to be incorrect. The risk of error can increase when the determination is made within a relatively short time following defendant's incompetency. Hence, if such a prediction is or can be wrong, other considerations, such as the protection of society and the public interest in effective law enforcement, militate strongly in favor of the right to continue or renew the prosecution or at least preserving the opportunity to do so.[1] Consequently dismissals of criminal charges under N.J.S.A. 2C:4-6e may be with or without prejudice depending upon the circumstances.
*388 The defendant's major argument in favor of a mandatory rule that all dismissals under N.J.S.A. 2C:4-6, section (e) as well as (c), must be with prejudice is based upon constitutional considerations. It is argued that only a construction of N.J.S.A. 2C:4-6 that mandates dismissals with prejudice would alleviate the potential constitutional problems noted by the Supreme Court in Jackson v. Indiana:
Dismissal of charges against an incompetent accused has usually been thought to be justified on grounds not squarely presented here: particularly, the Sixth-Fourteenth Amendment right to a speedy trial, or the denial of due process inherent in holding pending criminal charges indefinitely over the head of one who will never have a chance to prove his innocence. [406 U.S. at 740, 92 S.Ct. at 1859, 32 L.Ed.2d at 451-52 (footnotes omitted)]
Jackson itself does not mandate that the dismissal of criminal charges involving an incompetent must always be with prejudice in order to pass constitutional muster. In fact, there is no need for such a mandatory rule because these constitutional grounds for the dismissal of an indictment remain available to any defendant who can demonstrate a constitutionally significant injury attributable to undue delay in being brought to trial under appropriate circumstances. We do not perceive any reason why such considerations would not avail an incompetent defendant whose indictment has been dismissed without prejudice. A dismissal of criminal charges without prejudice does not imply their automatic reimposition. In fitting circumstances, such a defendant would doubtless, as a matter of elemental fairness and due process, be protected from any attempt to renew the prosecution against him, notwithstanding an earlier dismissal of the indictment without prejudice. See Jackson v. Indiana; United States v. Lancaster, 408 F. Supp. 225, 228-29 (D.D.C., 1976); State Ex Rel. Haskins v. County Court of Dodge Cty., 62 Wis.2d 250, 214 N.W.2d 575, 585-86 (1974) (validity of claims relating to speedy trial should be made on a case-by-case basis, not as a matter of law).
It is further asserted by defendant that if N.J.S.A. 2C:4-6 authorized dismissals without prejudice a mentally incompetent defendant would then be protected only by the *389 statute of limitations against the reinstatement of the indictment. Defendant also contends that those recently recovered from mental illness need broader protection than that afforded by the statute of limitations. The answer to these claims is that constitutional considerations relating to speedy trial, due process and fundamental fairness will serve, when appropriate, to bar such future prosecutions, even though not time-barred.

III
In conclusion, we hold that a criminal indictment shall be dismissed with prejudice under N.J.S.A. 2C:4-6c when it is determined that an adequate period of time has elapsed during which the defendant has been institutionalized and has remained unfit to be tried. The adequacy of the time in these circumstances is to be determined in terms of the real or likely prejudice to the rights of the defendant that can actually be shown or reasonably be inferred from the delay in bringing the matter to trial. We hold further that the dismissal of a criminal indictment under N.J.S.A. 2C:4-6 e may be with or without prejudice. This discretionary determination should be made upon a balancing of the strength of evidence that defendant's prospects for regaining competency appear hopeless, the period of time during which defendant has remained incompetent, the nature and extent of defendant's institutionalization, the likelihood of prejudice to the defendant in the trial following any delay, the gravity of the crimes charged and the public interest in prosecuting the charges. When these factors coalesce to establish the untenability of continuing a criminal prosecution, the indictment should be dismissed with prejudice. When this result is not demanded by the weighing of all relevant evidence, the indictment may be either dismissed without prejudice or held in abeyance in the sound discretion of the court.
In this case, it cannot be ascertained whether the trial court intended to dismiss the indictment under N.J.S.A. 2C:4-6 e with or without prejudice. Further, it does not appear that the trial *390 court considered, weighed and balanced all relevant factors in dismissing the charges against defendant. Accordingly the matter is remanded to the trial court, to proceed in a manner consistent with this opinion. Jurisdiction is not retained.
For remandment  Chief Justice WILENTZ and Justices CLIFFORD, SCHREIBER, POLLOCK, HANDLER and O'HERN  6.
Opposed  None.
NOTES
[1]  One of the major concerns expressed during the legislative hearings relating to the proposed dismissal authority was that the dismissal of serious criminal charges against an incompetent defendant who may regain competency to stand trial in two or three years would constitute a grave public disservice.

In State Ex Rel. Haskins v. County Court of Dodge Cty., 62 Wis.2d 250, 214 N.W.2d 575 (1974), the question as to whether a dismissal of criminal charges on grounds of incompetency should be with prejudice was presented by a class action on behalf of incompetent defendants who had been committed to a mental institution until found competent to stand trial, yet who had not been civilly committed. Responding to Jackson v. Indiana, 406 U.S. 715, 92 S.Ct. 1845, 32 L.Ed.2d 435 (1972), the court established procedures to insure that incompetent defendants would not remain criminally committed when there is little chance of regaining competency. The court required civil commitment or discharge of defendants to occur within 18 months of a finding of incompetency to stand trial. The court then noted, but did not resolve, the issue of whether the criminal proceedings should be terminated with prejudice in such cases. It outlined two positions, viz:
The State Public Defender takes the position that at such time as the defendant is found "hopelessly incompetent," the underlying criminal action must be dismissed with prejudice. The State Public Defender urges that this dismissal of a criminal action occur when the committing court makes that finding, irrespective of whether that finding is made after six months, twelve months, or eighteen months.
The Attorney General argues that a dismissal with prejudice should not be of course on the finding of probable indefinite incompetency but only at such time when it appears that an individual defendant could not even, were he to recover competence, have a fair trial because of his deprivation of a speedy trial. [214 N.W.2d at 578.]
