Reputation: 75
I have a Runnable jar file, is there anyway to embed it into html so people dont have to download my game to play?
Upvotes: 5
Views: 39530
Reputation: 168845
What you are looking for is Java Web Start. It can (install &) launch Java rich client apps. (e.g. Swing, SWT, AWT) from a link on a web page.
Note that both web-start & converting the app. to an applet mentioned by other people, would effectively download the Jar to the users computer, it's just that it is 'invisible' to them (unless it is 60+ megabytes - in which case the time will be noticed).
As an aside, speaking as someone with extensive experience of both applets and JWS, I strongly recommend to avoid applets for this one. Use JWS. It is easier, and no conversion of the 'main' class is required. Either way, the Jar will end up needing to be digitally signed.
Upvotes: 1
Reputation: 8101
An Applet is what you want...put the following inside your html..
<APPLET ARCHIVE="yourfile.jar" CODE="yourApplet.class" WIDTH=400 HEIGHT=200>
</APPLET>
Of course for this, your jar file must contain yourApplet.class
Upvotes: 8