I want to embed a java applet (stored in a git repository) in the accompanying github-pages page. Is this possible?
Asked
Active
Viewed 2,698 times
1
-
1GitHub pages allows you to serve any files you want. – SLaks Jul 13 '14 at 04:28
-
1http://stackoverflow.com/q/23281598/6309 could help – VonC Jul 13 '14 at 04:30
-
@SLaks Not server side files – Krish Munot Dec 01 '17 at 00:15
-
@KrishMunot: I said "serve any file". Server-side code is executed, not served. – SLaks Dec 01 '17 at 14:51
1 Answers
3
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).