JXBrowser ClassNotFoundException












1














I've problem with JXBrowser license file. I've followed https://jxbrowser-support.teamdev.com/docs/quickstart/gradle-config.html official guide to use with Gradle and this is my current build.Gradle



Build seem normal and no any error.



plugins {
id 'java'
}

sourceSets {
main {
java {
srcDir 'src'
}
}

test {
java {
srcDir 'test'
}
}
}

jar {
manifest {
attributes 'Main-Class': 'main.Main'
}
}

version '1.0'

sourceCompatibility = 1.8

repositories {
mavenCentral()
maven { url = 'http://maven.teamdev.com/repository/products' }
}

ext {
jxBrowserVersion = '6.22'
}

dependencies {
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
compile "com.teamdev.jxbrowser:jxbrowser-cross-platform:${jxBrowserVersion}"
compile 'com.maxmind.geoip2:geoip2:2.12.0'

compile files("$rootDir/license.jar")

testCompile group: 'junit', name: 'junit', version: '4.12'
}


Error happens when it run I'm not sure my build.Gradle is wrong or something here is error



Exception in thread "main" java.lang.NoClassDefFoundError: com/teamdev/jxbrowser/chromium/PermissionHandler
at main.Main.main(Main.java:8)
Caused by: java.lang.ClassNotFoundException: com.teamdev.jxbrowser.chromium.PermissionHandler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 1 more









share|improve this question





























    1














    I've problem with JXBrowser license file. I've followed https://jxbrowser-support.teamdev.com/docs/quickstart/gradle-config.html official guide to use with Gradle and this is my current build.Gradle



    Build seem normal and no any error.



    plugins {
    id 'java'
    }

    sourceSets {
    main {
    java {
    srcDir 'src'
    }
    }

    test {
    java {
    srcDir 'test'
    }
    }
    }

    jar {
    manifest {
    attributes 'Main-Class': 'main.Main'
    }
    }

    version '1.0'

    sourceCompatibility = 1.8

    repositories {
    mavenCentral()
    maven { url = 'http://maven.teamdev.com/repository/products' }
    }

    ext {
    jxBrowserVersion = '6.22'
    }

    dependencies {
    compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
    compile "com.teamdev.jxbrowser:jxbrowser-cross-platform:${jxBrowserVersion}"
    compile 'com.maxmind.geoip2:geoip2:2.12.0'

    compile files("$rootDir/license.jar")

    testCompile group: 'junit', name: 'junit', version: '4.12'
    }


    Error happens when it run I'm not sure my build.Gradle is wrong or something here is error



    Exception in thread "main" java.lang.NoClassDefFoundError: com/teamdev/jxbrowser/chromium/PermissionHandler
    at main.Main.main(Main.java:8)
    Caused by: java.lang.ClassNotFoundException: com.teamdev.jxbrowser.chromium.PermissionHandler
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 1 more









    share|improve this question



























      1












      1








      1







      I've problem with JXBrowser license file. I've followed https://jxbrowser-support.teamdev.com/docs/quickstart/gradle-config.html official guide to use with Gradle and this is my current build.Gradle



      Build seem normal and no any error.



      plugins {
      id 'java'
      }

      sourceSets {
      main {
      java {
      srcDir 'src'
      }
      }

      test {
      java {
      srcDir 'test'
      }
      }
      }

      jar {
      manifest {
      attributes 'Main-Class': 'main.Main'
      }
      }

      version '1.0'

      sourceCompatibility = 1.8

      repositories {
      mavenCentral()
      maven { url = 'http://maven.teamdev.com/repository/products' }
      }

      ext {
      jxBrowserVersion = '6.22'
      }

      dependencies {
      compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
      compile "com.teamdev.jxbrowser:jxbrowser-cross-platform:${jxBrowserVersion}"
      compile 'com.maxmind.geoip2:geoip2:2.12.0'

      compile files("$rootDir/license.jar")

      testCompile group: 'junit', name: 'junit', version: '4.12'
      }


      Error happens when it run I'm not sure my build.Gradle is wrong or something here is error



      Exception in thread "main" java.lang.NoClassDefFoundError: com/teamdev/jxbrowser/chromium/PermissionHandler
      at main.Main.main(Main.java:8)
      Caused by: java.lang.ClassNotFoundException: com.teamdev.jxbrowser.chromium.PermissionHandler
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 1 more









      share|improve this question















      I've problem with JXBrowser license file. I've followed https://jxbrowser-support.teamdev.com/docs/quickstart/gradle-config.html official guide to use with Gradle and this is my current build.Gradle



      Build seem normal and no any error.



      plugins {
      id 'java'
      }

      sourceSets {
      main {
      java {
      srcDir 'src'
      }
      }

      test {
      java {
      srcDir 'test'
      }
      }
      }

      jar {
      manifest {
      attributes 'Main-Class': 'main.Main'
      }
      }

      version '1.0'

      sourceCompatibility = 1.8

      repositories {
      mavenCentral()
      maven { url = 'http://maven.teamdev.com/repository/products' }
      }

      ext {
      jxBrowserVersion = '6.22'
      }

      dependencies {
      compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
      compile "com.teamdev.jxbrowser:jxbrowser-cross-platform:${jxBrowserVersion}"
      compile 'com.maxmind.geoip2:geoip2:2.12.0'

      compile files("$rootDir/license.jar")

      testCompile group: 'junit', name: 'junit', version: '4.12'
      }


      Error happens when it run I'm not sure my build.Gradle is wrong or something here is error



      Exception in thread "main" java.lang.NoClassDefFoundError: com/teamdev/jxbrowser/chromium/PermissionHandler
      at main.Main.main(Main.java:8)
      Caused by: java.lang.ClassNotFoundException: com.teamdev.jxbrowser.chromium.PermissionHandler
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 1 more






      java swing gradle build.gradle jxbrowser






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 17 '18 at 19:33

























      asked Nov 17 '18 at 18:51









      wiput1999

      6617




      6617
























          2 Answers
          2






          active

          oldest

          votes


















          1














          I suppose you see this exception when you run your Java application through an executable JAR file.



          This exception indicates that you didn't include JxBrowser JAR files into your application class path. I see that you include JxBrowser JAR files as compile dependencies into your build.gradle. It's OK during build, but not for production.



          Please make sure that you add JxBrowser JAR files into the classpath of your application. For example, you can download the required JAR files, put them into some directory, and configure the Class-Path attribute in your JAR file as show in the Oracle's tutorial.



          Or you can use the Gradle plugin that includes all dependencies into a single fat JAR. In this case you don't need to configure Java app classpath.






          share|improve this answer





















          • for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
            – wiput1999
            Nov 19 '18 at 13:06












          • pastebin.com/4M7wYHdy this is code I write
            – wiput1999
            Nov 19 '18 at 13:25










          • Current Gradle pastebin.com/DcC0WjuA
            – wiput1999
            Nov 19 '18 at 13:26










          • I forget another thing is license.jar is at project root
            – wiput1999
            Nov 19 '18 at 13:42



















          0














          Now it's work using JDK & JRE < 10






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53354447%2fjxbrowser-classnotfoundexception%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I suppose you see this exception when you run your Java application through an executable JAR file.



            This exception indicates that you didn't include JxBrowser JAR files into your application class path. I see that you include JxBrowser JAR files as compile dependencies into your build.gradle. It's OK during build, but not for production.



            Please make sure that you add JxBrowser JAR files into the classpath of your application. For example, you can download the required JAR files, put them into some directory, and configure the Class-Path attribute in your JAR file as show in the Oracle's tutorial.



            Or you can use the Gradle plugin that includes all dependencies into a single fat JAR. In this case you don't need to configure Java app classpath.






            share|improve this answer





















            • for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
              – wiput1999
              Nov 19 '18 at 13:06












            • pastebin.com/4M7wYHdy this is code I write
              – wiput1999
              Nov 19 '18 at 13:25










            • Current Gradle pastebin.com/DcC0WjuA
              – wiput1999
              Nov 19 '18 at 13:26










            • I forget another thing is license.jar is at project root
              – wiput1999
              Nov 19 '18 at 13:42
















            1














            I suppose you see this exception when you run your Java application through an executable JAR file.



            This exception indicates that you didn't include JxBrowser JAR files into your application class path. I see that you include JxBrowser JAR files as compile dependencies into your build.gradle. It's OK during build, but not for production.



            Please make sure that you add JxBrowser JAR files into the classpath of your application. For example, you can download the required JAR files, put them into some directory, and configure the Class-Path attribute in your JAR file as show in the Oracle's tutorial.



            Or you can use the Gradle plugin that includes all dependencies into a single fat JAR. In this case you don't need to configure Java app classpath.






            share|improve this answer





















            • for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
              – wiput1999
              Nov 19 '18 at 13:06












            • pastebin.com/4M7wYHdy this is code I write
              – wiput1999
              Nov 19 '18 at 13:25










            • Current Gradle pastebin.com/DcC0WjuA
              – wiput1999
              Nov 19 '18 at 13:26










            • I forget another thing is license.jar is at project root
              – wiput1999
              Nov 19 '18 at 13:42














            1












            1








            1






            I suppose you see this exception when you run your Java application through an executable JAR file.



            This exception indicates that you didn't include JxBrowser JAR files into your application class path. I see that you include JxBrowser JAR files as compile dependencies into your build.gradle. It's OK during build, but not for production.



            Please make sure that you add JxBrowser JAR files into the classpath of your application. For example, you can download the required JAR files, put them into some directory, and configure the Class-Path attribute in your JAR file as show in the Oracle's tutorial.



            Or you can use the Gradle plugin that includes all dependencies into a single fat JAR. In this case you don't need to configure Java app classpath.






            share|improve this answer












            I suppose you see this exception when you run your Java application through an executable JAR file.



            This exception indicates that you didn't include JxBrowser JAR files into your application class path. I see that you include JxBrowser JAR files as compile dependencies into your build.gradle. It's OK during build, but not for production.



            Please make sure that you add JxBrowser JAR files into the classpath of your application. For example, you can download the required JAR files, put them into some directory, and configure the Class-Path attribute in your JAR file as show in the Oracle's tutorial.



            Or you can use the Gradle plugin that includes all dependencies into a single fat JAR. In this case you don't need to configure Java app classpath.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 19 '18 at 11:58









            Vladimir

            1,99211621




            1,99211621












            • for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
              – wiput1999
              Nov 19 '18 at 13:06












            • pastebin.com/4M7wYHdy this is code I write
              – wiput1999
              Nov 19 '18 at 13:25










            • Current Gradle pastebin.com/DcC0WjuA
              – wiput1999
              Nov 19 '18 at 13:26










            • I forget another thing is license.jar is at project root
              – wiput1999
              Nov 19 '18 at 13:42


















            • for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
              – wiput1999
              Nov 19 '18 at 13:06












            • pastebin.com/4M7wYHdy this is code I write
              – wiput1999
              Nov 19 '18 at 13:25










            • Current Gradle pastebin.com/DcC0WjuA
              – wiput1999
              Nov 19 '18 at 13:26










            • I forget another thing is license.jar is at project root
              – wiput1999
              Nov 19 '18 at 13:42
















            for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
            – wiput1999
            Nov 19 '18 at 13:06






            for now -- Product name: JxBrowser -- Licensed version: 6.x -- Licensed to: -- License type: Evaluation -- Generation date: Nov 17, 2018 -- Expiration date: Dec 17, 2018 -- License info: Single-user license -- Current date: Nov 19, 2018 JxBrowser license valid. Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError License seem work but still Initialize Error I just use // Init web browser Browser browser = new Browser(); BrowserView view = new BrowserView(browser);
            – wiput1999
            Nov 19 '18 at 13:06














            pastebin.com/4M7wYHdy this is code I write
            – wiput1999
            Nov 19 '18 at 13:25




            pastebin.com/4M7wYHdy this is code I write
            – wiput1999
            Nov 19 '18 at 13:25












            Current Gradle pastebin.com/DcC0WjuA
            – wiput1999
            Nov 19 '18 at 13:26




            Current Gradle pastebin.com/DcC0WjuA
            – wiput1999
            Nov 19 '18 at 13:26












            I forget another thing is license.jar is at project root
            – wiput1999
            Nov 19 '18 at 13:42




            I forget another thing is license.jar is at project root
            – wiput1999
            Nov 19 '18 at 13:42













            0














            Now it's work using JDK & JRE < 10






            share|improve this answer


























              0














              Now it's work using JDK & JRE < 10






              share|improve this answer
























                0












                0








                0






                Now it's work using JDK & JRE < 10






                share|improve this answer












                Now it's work using JDK & JRE < 10







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 19 '18 at 22:56









                wiput1999

                6617




                6617






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53354447%2fjxbrowser-classnotfoundexception%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?