ZIO HTTP: Netty AnnotatedNoRouteToHostException null solution

As a note to self, I had a problem with the ZIO HTTP library, where it was throwing Netty errors/exceptions like this:

io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: jsonplaceholder.typicode.com.

The solution to this was to make a couple of changes to my SBT build.sbt file, specifically adding the javaOptions setting below, and forking the running application from SBT:

name := "Stocks"
version := "0.1"
scalaVersion := "3.3.3"

libraryDependencies ++= Seq(
    "dev.zio" %% "zio" % "2.0.22",
    "dev.zio" %% "zio-http" % "3.0.0-RC4",
    "dev.zio" %% "zio-json" % "0.6.2"
)

Compile / mainClass := Some("t1001.ZioJson104")

// [1] the next two settings resolve these errors when running in sbt:
// io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: jsonplaceholder.typicode.com.
// [2] https://stackoverflow.com/questions/37827347/use-javaoptions-from-build-sbt-during-runtime
// "javaOptions are only applied to a forked JVM"
//fork in run := true
fork := true
javaOptions ++= Seq(
    "-Djava.net.preferIPv4Stack=true"
)

scalacOptions += "-deprecation"

As noted, javaOptions only applies to a forked JVM, so you need both of these settings for this solution.