causes an exception of the specified class to be thrown in the Java thread that called the Mathematica program in which JavaThrow occurred.

JavaThrow["exception", "message"]
specifies an optional detail message for the exception.

causes the specified Java Exception object to be thrown.


  • To use JavaThrow, you first need to load J/Link using Needs["JLink`"].
  • JavaThrow is a specialized function that few programmers will have any use for.
  • It is up to the user to ensure that the exception being created has an appropriate constructor.
New to Mathematica? Find your learning path »
Have a question? Ask support »