'Why am I getting parse error on input "{"

I am trying to run the very first example in this tutorial:

Call JVM Methods from Haskell

module Main where

{-# LANGUAGE QuasiQuotes #-}
{-# OPTIONS_GHC -fplugin=Language.Java.Inline.Plugin #-}
import Language.Java (withJVM)
import Language.Java.Inline

main :: IO ()
main = withJVM [] [java| { System.out.println("Hello Java!"); } |]

and I get this error:

app\Main.hs:8:26: error: parse error on input `{'
  |
8 | main = withJVM [] [java| { System.out.println("Hello Java!"); } |]
  |                          ^

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source