[英]Multi-class java applet to jar to html
我已經將腦袋撞牆了幾個小時,試圖找到一個關於如何將具有多個類文件的applet編譯為html文件的“好”教程。
我可能會以錯誤的方式進行操作。 那或者我錯了怎么做。
我有3類:粒子(主)粒子O和處理程序
在cmd中,我輸入命令:
jar cvfm Particle.jar manifest.txt *.*
表現:
Main-Class: Particles
(anextralinehere)
(我在src目錄中)
它可以很好地編譯(我認為,我沒有收到任何錯誤)
我做一個index.html
<html>
<head>
<title> Particle </title>
</head>
<body>
<applet code='Particles.class'
archive='Particle.jar',
width="1200", height="600"/>
</applet>
</body>
</html>
當我打開文件並且小程序說這是錯誤時,我的瀏覽器崩潰了
編輯/更新錯誤是:“ ClassNotFoundException”“ Particles.class”
您的“代碼”屬性不正確,您需要做的是code =“ jarName.className”。 您不需要.class擴展名。
在您的情況下,您需要將代碼屬性更改為code =“ Particle.Particle”
希望有幫助:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.