JavaFX and external JARs

后端 未结 4 1983
鱼传尺愫
鱼传尺愫 2021-01-21 15:18

I am trying to deploy JavaFX application, but when I run it in browser, it looks like it cannot find the classes in external jar files.

java.lang.RuntimeExcepti         


        
4条回答
  •  既然无缘
    2021-01-21 16:04

    I faced similar situations .. I dont know exactly which solution is what may help you .. so I will list them all :

    1- be sure that the jar you are using are signed and signature is valid .. you can use jarsigner for this purposes .. because if the jars you are using are expired.. app will crash @ web. if there is a jar signed and expired . just remove all file from META-INF. ( jar is zip file btw)

    2-I see your JNLP .. you need to add this attribute for the application class: main="true" so your will be :

    
        
        
        
        
        
        
        
        
    
    

    Its important to tell app which is your application class .. I dont know why .. but I found this structure in previous version of JavaFX and it solved my problem ..

    3- if you are using webPage instead of generic one .. so just check that JNLP_content serial is the same .. because each time you add/remove jars to project, the serial will be changed .consider checking URL as well .. I mean this section in HTML:

     function javafxEmbed() {
        dtjava.embed(
            {
                url : 'BSigner_v1.5_release.jnlp',
                placeholder : 'javafx-app-placeholder',
                width : 500,
                height : 100,
                jnlp_content : 'PD94bWwgd0iYnNwc2lnbmVyX3YxLnBrZzRfcmVsZWFzZS5NYWluIiAgbmFtZT0iQlNQU2lnbmVyX3YxLjVfcmVsZWFzZSIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
            },
            {
                javafx : '2.2+'
            },
            {}
        );
    }
    

    hope that is gonna help you or anyone facing the same issue ..

    Good luck

提交回复
热议问题