Amitabh,

Just to clarify, since I missed stating this in my last two messages regarding your issue...

When developing a /modular/ Java project, the only items that should be listed in your Libraries node in the Projects window of NetBeans IDE should be the JDK that you are currently using and any third-party libraries that you have added as dependencies to your project.

Within the JDK18 library that is currently in your Libraries node, the java.sql package is located. In order for your project to use the SQL API libraries, you must type a "requires java.sql;" statement in the module-info.java /in each module that relies upon the SQL API/. Until such time that you place those requires statements in each module needing it, none of your modules will be able to access the SQL API.

One further note: This is /not/ a NetBeans, nor a NetBeans configuration, issue. This is completely due to the way the JDK has been organized since JDK9, when the JDK was modularized under Project Jigsaw. Google the phrase "Project Jigsaw" and do some reading so that you can better understand how the JDK is organized. By doing this, it will help you to better understand how to use the JDK more effectively.

-SC

On 2/13/23 1:21 PM, Sean Carrick wrote:

One more time...

You _/*must add the dependency in your module.info file*/_. The only module of the JDK that is included by default in any modular Java project is the java.base module. /All other needed modules *must be* manually included in your module-info.java file. /For example:

module my.module {
     requires java.sql;    // java.base is IMPLICITLY required
     requires java.desktop; // For developing Java/Swing GUI applications
// Add your exports, uses, and provides statements below.
}

To see which modules are included with the java.base module, see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/module-summary.html <https://docs.oracle.com/en/java/javase/11/docs/api/java.base/module-summary.html>. If the module (such as java.sql) is not listed on this page, then it is /not /part of java.base. You could save a lot of "requires" statements in your module-info.java file by including a grouping such as java.se. This will give you access to java.desktop packages, java.sql packages, as well as many others that are typically needed for J2SE application development.

You ought to bookmark this link: https://docs.oracle.com/en/java/javase/14/docs/api/

That link is to the Java API JavaDoc pages for JDK 14. If you need a different version of the JDK, change the 14 in the link above to the version you are interested in.

-SC

On 2/13/23 12:57 PM, Amitabh Choudhury wrote:
This is the bunch of  screenshots.

On Tue, Feb 14, 2023 at 12:15 AM Amitabh Choudhury <amitabhisg...@gmail.com <mailto:amitabhisg...@gmail.com>> wrote:

    Hi Ernie (and others)

    Have used all default configurations. There is java.sql module.
    That is being displayed in "Java Platform Manager" but not
    getting displayed in "Libraries" of the Ant application.
    Screenshots are attached.
    All settings are defaults.

    So, the action required is to include the java.sql module in the
    Libraries of the application. Even though it is in Java Platform
    Manager, its missing in the default libraries.

    Please guide.

    Warm wishes



    On Mon, Feb 13, 2023 at 11:42 PM Ernie Rael <err...@raelity.com
    <mailto:err...@raelity.com>> wrote:

        The sql stuff is not in the "java.base" module; there are
        separate
        modules for the sql stuff. I don't use modules, but I'm
        guessing the
        problem is how your app (not NetBeans) is configured.

        -ernie

        On 23/02/13 9:45 AM, Amitabh Choudhury wrote:
        > Hello
        >
        > This is in continuation of my previous mail related to
        Netbeans 14.
        >
        > Got aware that Netbeans 14 isn't supported, so downloaded
        Netbeans 16
        > and configured with Java 18.
        >
        > Created Ant project and checked java.base.
        > java.sql is missing in this as well.
        >
        > Please guide to configure Netbeans 16 to include java.sql
        in java.base
        > module of Default Library.
        > Images attached ...
        >
        > Warm wishes
        >
        > ~~~
        > Amitabh Choudhury
        >
        >
        ---------------------------------------------------------------------
        > To unsubscribe, e-mail:
        users-unsubscr...@netbeans.apache.org
        <mailto:users-unsubscr...@netbeans.apache.org>
        > For additional commands, e-mail:
        users-h...@netbeans.apache.org
        <mailto:users-h...@netbeans.apache.org>
        >
        > For further information about the NetBeans mailing lists,
        visit:
        >
        https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
        <https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>



        ---------------------------------------------------------------------
        To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
        <mailto:users-unsubscr...@netbeans.apache.org>
        For additional commands, e-mail:
        users-h...@netbeans.apache.org
        <mailto:users-h...@netbeans.apache.org>

        For further information about the NetBeans mailing lists, visit:
        https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
        <https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>


---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@netbeans.apache.org
For additional commands, e-mail:users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Attachment: OpenPGP_0xA195702ECF56996D.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to