سؤال

تمت تغطية هذا الموضوع في شكل واحد أو آخر ولكن لم يتمكن أي من المواضيع الأخرى من المساعدة. مشابه مشابه جدا لهذه المنشور، وأنا أقدم رسم بياني للأشونغ بوظائف إضافية، ولكن لا ساعد أي من الحلول:

href="https://stackoverflow.com/questions/6761271/japplet-to-html-problem"> فشل Japplet في صفحة HTML

كان لدي تطبيق Java الذي قمت بتحويله إلى Japplet. يعمل Japplet بشكل جيد في عارض التطبيق الصغير في الكسوف ولكن لن يعمل عندما أحاول فتحه في صفحة ويب (لقد جربتها IE و Firefox و Chrome). لدي صفحة HTML ومجلد الأرشيف في نفس الدليل. عندما أقوم بتحميل صفحة HTML، فإنه يطرح شيئا فقط.

هنا هو رمز HTML الخاص بي: giveacodicetagpre.

عندما أحاول الحصول على رمز="bptester.class" يعطي java.lang.classnotfoundException: bptester.class ولكن عندما أستخدم code="prerna.blueprint.main.bptester.class" يعطيني أي أخطاء فقط لا شيء يحدث. (Prerna / Blueprint / Main / bptester.class هو مسار الملف في مجلد SRC الخاص بي). قمت بتصدير مشروع Java الخاص بي كملف جرة رونابل، هل هذا صحيح؟ لقد أنشأت Japplet بسيطة عملت بشكل جيد عندما فعلت كل الخطوات نفسها، لكنها لن تعمل من أجل BPTSORT.CLASS.

إذا كنت بحاجة إلى نشر رمز BPTSTEST.CLASS الخاص بي، يمكنني.

أنا لا أفهم لماذا لا يمكنني عرض Japplet في صفحة ويب، أي مساعدة موضع تقدير كبير.

هل كانت مفيدة؟

المحلول

What ended up working for me was adding every single jar I used in the japplet to the HTML archive tag then had to sign every jar. I then had an issue with accessing my database within the applet1.jar so I just put an absolute path for its location.

نصائح أخرى

java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)

The applet needs to be digitally signed (by you) and trusted (by the end user, when prompted) before it can obtain such information. Given this applet is being deployed using a traditional applet element (i.e. not using web start), all jars need to be signed.

You need to sign every jar. You can sign all the jars with the jarsigner utility. Example:

jarsigner.exe "nameofthejar.jar" "alias"

Remove .class from the end. You either use a file path with slashes and .class at the end or you only use periods and no .class at the end.

Try turning on tracing in the java control panel. It will then produce a log file in the following path that may help: %USERPROFILE%\AppData\LocalLow\sun\java\Deployment\log

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top