You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by KARTHIK SHIVAKUMAR <ns...@gmail.com> on 2022/04/17 14:07:37 UTC

Module or Classpath

Hi

Spec JDK17/Linux/EclipaeJ2EEIDE

Question  :  log4j2-core.xx / log4j2-api.xx   need to add as *module OR
classpath *
                    for a new project built from scratch ?

-- 

*with regards*
*N.S.KARTHIK*

Re: Module or Classpath

Posted by KARTHIK SHIVAKUMAR <ns...@gmail.com>.
Thx for the same.... This is exactly i have been doing ( ignore
module-info.java)

This whole JPMS is a confusion with no proper  info across  jars available
in Maven  repository for module vs classpath usage...


with regards
Karthik

On Tue, Apr 19, 2022 at 6:47 PM Piotr P. Karwasz <pi...@gmail.com>
wrote:

> Hello Karthik,
>
> On Tue, 19 Apr 2022 at 14:45, KARTHIK SHIVAKUMAR <ns...@gmail.com>
> wrote:
>
> > I need log4j2 to log all of the  info/debug  objects across the project.
> > If i add  log4j2-core & log4j2-api to the project library,  the packages
> > do not recognise the log4j objects  unless  there is a entry to
> > 'module-info.java
> >
>
> Yes, if you want to use the Java Platform Module System, you need to add:
>
> requires org.apache.logging.log4j;
>
> to your `module-info.java` file (and put Log4j jars on the module path).
>
> However JPMS is not very widespread, so in an initial version of your
> project I wouldn't bother with modules and I would remove
> `module-info.java`.
>
> Piotr
>


-- 

*with regards*
*N.S.KARTHIK*

Re: Module or Classpath

Posted by "Piotr P. Karwasz" <pi...@gmail.com>.
Hello Karthik,

On Tue, 19 Apr 2022 at 14:45, KARTHIK SHIVAKUMAR <ns...@gmail.com>
wrote:

> I need log4j2 to log all of the  info/debug  objects across the project.
> If i add  log4j2-core & log4j2-api to the project library,  the packages
> do not recognise the log4j objects  unless  there is a entry to
> 'module-info.java
>

Yes, if you want to use the Java Platform Module System, you need to add:

requires org.apache.logging.log4j;

to your `module-info.java` file (and put Log4j jars on the module path).

However JPMS is not very widespread, so in an initial version of your
project I wouldn't bother with modules and I would remove
`module-info.java`.

Piotr

Re: Module or Classpath

Posted by KARTHIK SHIVAKUMAR <ns...@gmail.com>.
Hi

I create a new java project  ( with module-info.java ) automatically
created by  IDE ( Eclipse J2EEIDE )
I need log4j2 to log all of the  info/debug  objects across the project.
If i add  log4j2-core & log4j2-api to the project library,  the packages
do not recognise the log4j objects  unless  there is a entry to
'module-info.java

So the Question is  Should the Log4j jar be part of  Classpath  OR   to
Modulepath of the IDE to use  across ??


with regards
Karthik

On Sun, Apr 17, 2022 at 8:08 PM Ralph Goers <ra...@dslextreme.com>
wrote:

> I’m not quite clear on the question.
>
> Ralph
>
> > On Apr 17, 2022, at 4:07 PM, KARTHIK SHIVAKUMAR <ns...@gmail.com>
> wrote:
> >
> > Hi
> >
> > Spec JDK17/Linux/EclipaeJ2EEIDE
> >
> > Question  :  log4j2-core.xx / log4j2-api.xx   need to add as *module OR
> > classpath *
> >                    for a new project built from scratch ?
> >
> > --
> >
> > *with regards*
> > *N.S.KARTHIK*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

-- 

*with regards*
*N.S.KARTHIK*

Re: Module or Classpath

Posted by Ralph Goers <ra...@dslextreme.com>.
I’m not quite clear on the question.

Ralph

> On Apr 17, 2022, at 4:07 PM, KARTHIK SHIVAKUMAR <ns...@gmail.com> wrote:
> 
> Hi
> 
> Spec JDK17/Linux/EclipaeJ2EEIDE
> 
> Question  :  log4j2-core.xx / log4j2-api.xx   need to add as *module OR
> classpath *
>                    for a new project built from scratch ?
> 
> -- 
> 
> *with regards*
> *N.S.KARTHIK*


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org