http://bugs.winehq.org/show_bug.cgi?id=29424
--- Comment #10 from Jason Edmeades us@edmeades.me.uk 2012-09-03 17:22:44 CDT --- Which java was installed - 32 or 64 bit? I wonder if its possible that wine found the java.exe in the system32 directory (system jvm in effect) and found it as a 64 bit binary and 32 bit couldnt recognize it.
From comment 7, it does imply the root cause here is a java.exe in system32
(current directory is searched ahead of the path), which is seen as invalid but its pure presence prevents a subsequent path search.
One test would be to 'cd' out of SYSTEM32 and see if it then works (cd , java -version). The other is to confirm a presence of java.exe in system32 and try to run it explicitly.