The Java documentation for Math.pow
states:
If the first argument is finite and less than zero [...] [and] if the second argument is finite and not an integer, then the result is NaN.
You could use Math.cbrt
to get the cube root:
double result = Math.cbrt(-8.0);