问题
I want to embed a java applet (stored in a git repository) in the accompanying github-pages page. Is this possible?
回答1:
Yes.
Although GitHub pages can be generated through a simple markdown interface, any files in your branch will be served as part of your gh-pages-site.
This means you can host client side scripts like Java-Applets or JS on your GitHub Pages site.
To host a java applet:
- Create a jar file for your Applet.
- Place the .jar file into the root of your gh-pages branch.
Embed the applet in one of your html pages using your prefered method like this, or maybe this:
*Assuming foo.jar and Bar.class are your file and applet-class* <embed id="SomeName" type="application/x-java-applet;version=1.6" width="999" height="999" archive="foo.jar" code="Bar.class" pluginspage="http://java.com/download/" myParam="YourParams" />
Commit/Push the changes and wait (sometimes gh-pages are not updated immediately).
来源:https://stackoverflow.com/questions/24719538/can-an-embedded-java-applet-be-hosted-on-git-pages