1

I am developing a JAVAFX application which requires GoogleDrive connectivity inorder to store and retrieve data. Since Java11 doesn't include JAVAFX i have used to mergefx inorder to create a merged JDK with FX library. I am able to run the application in Eclipse latest version without any error and is able to connect with Googledrive via browser. In order to create a standalone version, I have used Jlink to create a JRE. Also to avoid the use of .bat file to execute the application, I have used Launch4j to create a .exe file of application. The .exe file has been created successfully,but while trying to connect with Googledrive, its showing the following error:

Caused by: java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

Please let me know your suggestions,which will be really helpful.

ESCoder
  • 15,431
  • 2
  • 19
  • 42
Sarada
  • 23
  • 4
  • Does this help? [How to download com.sun.net.httpserver package?](https://stackoverflow.com/questions/4484989/how-to-download-com-sun-net-httpserver-package) – Abra Apr 08 '20 at 02:47
  • Thanks for the reply Abra, actually,I was able to run it successfully once after editing the jlink command. I missed to add one of the package while creating the JRE. – Sarada Apr 08 '20 at 09:08

1 Answers1

0

Assuming you are using the module system, you likely need the following line in module-info.java:

requires jdk.httpserver;

The class may be present but you have to declare use of the module with the class