So my friend keeps making requests about this plugin I am writing for Bukkit and, like the decent person I am, I accept them. Unfortunately I am not that great of a programmer. I am making a help page for this plugin – A local file that comes with the plugin – and I need to know how I can run the .jar file of the plugin. I have the main class all ready, and they way I plan to do it is have something like this as part of the <head></head> tags.
<script> <!--
if(confirm("Would you like to run the plugin to set up first? (Click cancel if you do not)")) {
//Something to run the plugin .jar file
}
//-->
</script>
Would this work? If I need to make any modifications, just let me know. I think I may only be able to call functions, in which case I will just call main().
NOTE: This works as-is, I just have it make another popup instead of running the .jar file. NOTE: Both the webpage and the jarfile are already downloaded onto the user’s computer, I just need to be able to run it.
NOTE: This webpage is literally an HTML file that is downloaded to their computer when they download the plugin, and I want it to run my plugin because that it an automated setup function. The website is NOT hosted on a server. I feel like I REALLY need to clarify that.
Looked through the code and decided that a link would be easiest and best for my purposes – Thanks for all the help! (By the way, it turned out that I would have the .jar file unpack the help document into the folder. Oh well :P)
Another thing you can look into is the Java Web Start framework:
http://en.wikipedia.org/wiki/Java_Web_Start
This allows users to launch an arbitrary jar file directly from their browsers and optionally install it on their machines. So, if all you are looking for is a way to deploy your Java program via a website, this might be the best solution.
In this scenario, the Java code would not run “inside” the browser (well, inside the JVM, but tied to the browser), like an applet would, but instead it would run as a standard separate process as if you had launched the jar file from your computer’s hard-disk.