The attached test cases show an HTML5 example that lacks an initial moveto (It is an HTML5 tutorial example with the initial moveTo replaced by a lineTo), yet it draws the same thing that it would have drawn with the moveTo. The similar FX Canvas example throws an Exception for the same path elements (but works if you substitute back in the moveTo).
Load test.htm into a browser to see the expected output.
Compile and run test.java to see the exception. Modify test.java to replace the first lineTo with the indicated moveTo and it will produce the same results as the HTML file. It should do so even with the lineTo.