You'll need JRE 1.3.1 or later to get this to work, otherwise the service will shut down as you logoff.
java -Xrs -jar oc4j.jar >>log.txt
The -Xrs is the important part here, which reduces the VM's sensitivity to OS commands. Note that it also disables the Ctrl-C break and kills through task manager, so you'll need to run admin.jar -shutdown to stop the AS.
Try running java -X to read more about advanced options when running java applications.