You can use script tag with type as text/javascript to put the code inside HTML.
<html>
<body>
<script type='text/javascript'>
document.write("java.version " + java.lang.System.getProperty("java.version"));
</script>
</body>
</html>
If you have a button-HTML and you want to call certain function then you can do in the following way
<input name="mydoc" onclick="return my_java_func()" >
If looking something different then please comment with proper info.