Adding a Third Party Library to Java Applet

情到浓时终转凉″ 提交于 2019-11-28 01:28:26

Do you want to embed your applet into a website / HTML with the applet tag?

<applet code="de.package.AppletClass" 
archive="apache-commons-lang.jar">
</applet>

Deploying With the Applet Tag

To compile it in console use:

javac -classpath C:\dev\YourClass.java C:\dev\3thParty.jar

Compiling the Example Programs

Put the other jars in the Class-Path property in the manifest.mf and build an index to the other jars so that the loader won't have to download a jar unless it really needs it.

Alternatively, you can mention the jars in the archive tag. In archive tag you can add multiple jars: archive="MyJar.jar,JarFile1.jar,JarFile2.jar"

So your archive attribute will be like this archive="YourProject.jar,commons-lang-2.1.jar" (Remember that you have to put commons-lang-2.1.jar with YourProject.jar in the same dir on your server.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!