JWS Class not found error

↘锁芯ラ 提交于 2019-12-11 19:33:47

问题


I was trying to explore how the JWS works end to end, was following this blog. JWS tutorial link

initially got "unsigned jar error" stackoverflow post- may be fixed now, but now its throwing class not found, tried multiple things like creating a class without package etc etc, but still its not working. A new class with the steps etc.

I am not sure if its some version compatibility issue or not.

Apache tomcat - 8.0.23 Java -1.8.0_40-b26


JNLP file details

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="JNLPExample.jnlp">

     <information>
          <title>JNLP Example</title>
          <vendor>Java Code Geeks</vendor>
          <homepage href="http://localhost:8080/" />
          <description>JNLP Testing</description>
     </information>

     <security>
          <all-permissions/>
     </security>

     <resources>
          <j2se version="1.6+" />
          <jar href="JNLPExample.jar" />
     </resources>

     <application-desc main-class="main.javacodegeeks.JNLPExample" />
</jnlp>

Class details

package main.javacodegeeks;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class JNLPExample extends JFrame {

     private static final long serialVersionUID = 4968624166243565348L;

     private JLabel label = new JLabel("Hello from Java Code Geeks!");

     public JNLPExample() {
          super("Jave Web Start Example");
          this.setSize(350, 200);
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          this.setLayout(null);
     }

     public void addButtons() {
          label.setSize(200, 30);
          label.setLocation(80, 50);
          this.getContentPane().add(label);
     }

     public static void main(String[] args) {
          JNLPExample exp = new JNLPExample();
          exp.addButtons();
          exp.setVisible(true);
     }
}


回答1:


JWS needs the external jars to b in the \lib\ext directory.



来源:https://stackoverflow.com/questions/31260333/jws-class-not-found-error

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