You should install java. In 8.1.6 you may just run initjvm.sql, but for 8.1.7 it's quite complex procedure (described somewhere at metalink), so it would be better to install it as a part of database installation. As for storing a file, the answer is NOWHERE. It just outputs the result to sql*plus screen. If you need to store it to a file, use SPOOL command. You may also need to add more commands to prevent plus from echoing commands and printing some other unuseful for your case information:
set feedback off
set serverout off
set termout off
Regards, Dima