converts the specified Java object reference into its value as a "native" Wolfram Language expression.


  • To use JavaObjectToExpression, you first need to load J/Link using Needs["JLink`"].
  • Normally, all Java objects that have a meaningful "by value" representation in the Wolfram Language are returned by value to the Wolfram Language automatically. Such objects include strings, arrays (these become lists), and instances of so-called wrapper classes like java.lang.Integer. However, you can get a reference form of one of these types if you explicitly call JavaNew or use the ReturnAsJavaObject function. In such cases, you can use JavaObjectToExpression to retrieve the value.
  • JavaObjectToExpression has no effect on objects that have no meaningful "value" representation in the Wolfram Language.
Translate this page: