Question

Ce sujet a été recouvert d'une forme ou d'une autre, mais aucun des autres threads n'a été capable d'aider. Mon problème est très similaire à ce post, je fais un graphique Jung avec une fonctionnalité ajoutée, mais aucune des solutions n'a aidé:

JapPlet échoue à une page HTML

J'ai eu une application Java que j'ai convertie en japplé. Le japplet fonctionne bien dans l'énigme d'applet dans Eclipse mais ne fonctionnera pas lorsque j'essaie de l'ouvrir dans une page Web (j'ai essayé, Firefox et Chrome). J'ai mon page HTML et mon dossier d'archivage dans le même répertoire. Lorsque je charge la page HTML, il ne fait que rien.

Voici mon code HTML:

<html>
<title>Applet</title>
<head>

</head>
<body>

<applet code="prerna.blueprint.main.BPTester.class" 
        archive="applet1.jar"
        width="800" height="800">
</applet>

</body>
</html>

Quand j'essaie d'avoir du code="Bptestter.class", il donne java.lang.classnotfoundexception: bptestter.class mais quand j'utilise le code="prerna.blueprint.main.bpterster.class" Cela ne me donne aucune erreur arrive. (Prerna / Blueprint / Main / Bptestter.Class est le chemin de fichier dans mon dossier SRC). J'ai exporté mon projet Java en tant que fichier jar runnable, est-ce correct? J'ai créé un simple japplet qui a fonctionné bien lorsque j'ai fait toutes les mêmes étapes, mais cela ne fonctionnera pas pour Bptestter.class.

Si j'ai besoin de poster mon code Bptestter.class, je peux.

Je ne comprends pas pourquoi je ne peux pas voir le japplet dans une page Web, aucune aide est grandement appréciée.

Était-ce utile?

La solution

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.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top