• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run a .jar in a browser

 
Connor Advent
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a .jar that runs just fine on its own in Windows with JRE.

I am trying to get it to run on my website. The HTML code is the following:



What am I supposed to put for the .class? I only have .jar and I have no idea what class I am supposed to use. I have very little Java experience. How can I accomplish this?

Thank you,
 
Connor Advent
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bump.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "runs just fine" - are you double-clicking the jar file on your desktop? If so, it's an application, not an applet. Unless the jar file also contains an applet class, there's no way to get it to work in a browser as is.
 
Connor Advent
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply!

When I double click the .jar in Windows it does open, yes. However, in the root directory of the .jar there is an applet class and a bunch of folders.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if there is, in fact, an applet class, then its name should go into the "code" attribute.
 
Connor Advent
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind I think I was mistaken. The file in the root of the .jar is called java.policy.applet. I am assuming this isn't what you meant since this is all it contains:



This means then it must be an application. Is there any way I can make this an applet?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The http://www.acme.com/resources/classes/Acme/ApplicationApplet.java class does that to a certain degree.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic