abhi376
asked on
Java Applet jar file including external libraries in the jar file
Hello,
I built a applet. I want to include the external jar files in to the applet jar file. How can I do that. I'm getting a black screen when I run the applet. How do I debug it and I'm guess I'm not including the external libraries in the jar
I built a applet. I want to include the external jar files in to the applet jar file. How can I do that. I'm getting a black screen when I run the applet. How do I debug it and I'm guess I'm not including the external libraries in the jar
You need to include the jars in the applet's archive tag
ASKER
how to do that in netbeans ???
see the following
http://netbeans.org/kb/docs/web/applets.html
If you have an extra jar, say a.jar that it needs then the html becomes
<applet code="org.me.hello.MyApple t" archive="HelloApplet.jar, a.jar"/>
and put a.jar in the same location as the applet jar
Let me know if you have any questions
http://netbeans.org/kb/docs/web/applets.html
If you have an extra jar, say a.jar that it needs then the html becomes
<applet code="org.me.hello.MyApple
and put a.jar in the same location as the applet jar
Let me know if you have any questions
ASKER
I need to uplaod a jar file in to a system which allows me to upload only single file for the applet
well an applet requires at least two files, the html file, and a jar (or class file).
if you want to include all the classes in a single jar then have a look here
http://joshuaborn.info/blog/cb49
if you want to include all the classes in a single jar then have a look here
http://joshuaborn.info/blog/cb49
ASKER
Hi,
I got the Fat Jar plugin for the eclipse and made the jar with all the dependencies but I'm not able to make the html page out of the applet. I can run the applet from class right click run. The applet starts up and java animation run and applet never show up how can I debug this ??
I got the Fat Jar plugin for the eclipse and made the jar with all the dependencies but I'm not able to make the html page out of the applet. I can run the applet from class right click run. The applet starts up and java animation run and applet never show up how can I debug this ??
ASKER
When I make html page out of the applet. The html page runs and shows up the java animation. Is this due to any controls inside the applet ? I
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yea. I followed the same. I open the html file. I get java logo animation on the applet.nothing else after sometime a black screen
check your java console for any errors
ASKER
I don't see any errors in the console. If I run the app it just runs fine
ASKER
Exception in thread "thread applet-splaytree.Control-1 " java.lang.ExceptionInIniti alizerErro r
at org.objenesis.ObjenesisStd .<init>(Ob jenesisStd .java:31)
at com.rits.cloning.Cloner.<i nit>(Unkno wn Source)
at splaytree.Splay.<init>(Spl ay.java:11 )
at splaytree.MyCanvas.<init>( MyCanvas.j ava:16)
at splaytree.Control.init(Con trol.java: 41)
at sun.plugin2.applet.Plugin2 Manager$Ap pletExecut ionRunnabl e.run(Unkn own Source)
at java.lang.Thread.run(Unkno wn Source)
Caused by: java.security.AccessContro lException : access denied (java.util.PropertyPermiss ion java.runtime.version read)
at java.security.AccessContro lContext.c heckPermis sion(Unkno wn Source)
at java.security.AccessContro ller.check Permission (Unknown Source)
at java.lang.SecurityManager. checkPermi ssion(Unkn own Source)
at java.lang.SecurityManager. checkPrope rtyAccess( Unknown Source)
at java.lang.System.getProper ty(Unknown Source)
at org.objenesis.strategy.Bas eInstantia torStrateg y.<clinit> (BaseInsta ntiatorStr ategy.java :38)
... 7 more
This is the error I see in the java console
at org.objenesis.ObjenesisStd
at com.rits.cloning.Cloner.<i
at splaytree.Splay.<init>(Spl
at splaytree.MyCanvas.<init>(
at splaytree.Control.init(Con
at sun.plugin2.applet.Plugin2
at java.lang.Thread.run(Unkno
Caused by: java.security.AccessContro
at java.security.AccessContro
at java.security.AccessContro
at java.lang.SecurityManager.
at java.lang.SecurityManager.
at java.lang.System.getProper
at org.objenesis.strategy.Bas
... 7 more
This is the error I see in the java console
ASKER
yea. I self signed my jar but it gives the error message saying its not verified. Can I avoid that ??
you need to purchase a certificate to fix that
ASKER
Will applet.policy work ? I know applet.policy is local for the user I was just wondering
yes it would work
Altering the policy file is only a viable option if the applet has only limited distribution - it has to be altered for any and every box it's run on