That is not JavaScript - it is Java. Best avoided since many (perhaps
most) users have Java disabled or not installed.
JavaScript is completely different and almost all users have this enabled.
JavaScript does not require applets source or base URLs.
Trevor's response shows how to add JavaScript to a page.