Re: use of Deprecated annotation error

2023-02-04 Thread Michael Bien

no problem.

That is also the main reason I really would like to see NB finally move 
to JDK 11 or later, so that it can use more modern APIs.


-mbien


On 05.02.23 01:39, Brad Walker wrote:

Thanks!

Completely understand.

-brad w.


On Sat, Feb 4, 2023 at 6:37 PM Michael Bien  wrote:

Hi Brad,

the @Deprecated annotation itself is old, however the attributes
since/forRemoval are newer (probably JDK11 if I remember correctly).

This means that this will only work in modules which have their
bytecode
level set to 11 (there aren't many).

Javac of JDK 17 on your system is doing its job, its just that the
modules ask for java 8 compatibility so it can't allow those
attributes.

hope this helps,
michael



On 05.02.23 01:14, Brad Walker wrote:
> I'm pulling my hair out trying to figure something out when I
use the
> @Deprecaed
> annotation.
>
> For example, if I do the following in JarClassLoader.java, line 866
>
>         /** Delete any temporary JARs we were holding on to.
>           * Also close any other JARs in our list.
>           */
> *        @Deprecated(since="9", forRemoval=true)*
>          @Override
>          protected void finalize() throws Throwable {
>              super.finalize();
>
>              doCloseJar();
>
>              if (dead) {
>                  LOGGER.log(Level.FINE, "#21114: closing and
deleting
> temporary JAR {0}", file);
>                  if (file.isFile() && !file.delete()) {
>                      LOGGER.log(Level.FINE, "(but failed to
delete {0})",
> file);
>                  }
>              }
>          }
>
> I get the following error:
>
> -do-compile:
>     [depend] Deleted 12 out of date files in 0 seconds
>   [nb-javac] Compiling 18 source files to
> /home/bwalker/src/netbeans/platform/o.n.bootstrap/build/classes
>   [nb-javac] Ignoring source, target and bootclasspath as
release has been
> set
>     [repeat]
>

/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
> error: cannot find symbol
>     [repeat] @Deprecated(since="9", forRemoval=true)
>     [repeat]            ^
>     [repeat]   symbol:   method since()
>     [repeat]   location: @interface Deprecated
>     [repeat]
>

/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
> error: cannot find symbol
>     [repeat] @Deprecated(since="9", forRemoval=true)
>     [repeat]                       ^
>     [repeat]   symbol:   method forRemoval()
>     [repeat]   location: @interface Deprecated
>     [repeat] 2 errors
>    [nbmerge] Failed to build target: all-o.n.bootstrap
>
> Which says to me that it's compiling with javac for 1.8.
>
> Yet my path is set to use the version 17 of javac..
>
> [bwalker@fedora netbeans]$ javac -version
> javac 17.0.5
> [bwalker@fedora netbeans]$
>
> Ideas about where I should look for clues?
>
> -brad w.
>



Re: use of Deprecated annotation error

2023-02-04 Thread Brad Walker
Thanks!

Completely understand.

-brad w.


On Sat, Feb 4, 2023 at 6:37 PM Michael Bien  wrote:

> Hi Brad,
>
> the @Deprecated annotation itself is old, however the attributes
> since/forRemoval are newer (probably JDK11 if I remember correctly).
>
> This means that this will only work in modules which have their bytecode
> level set to 11 (there aren't many).
>
> Javac of JDK 17 on your system is doing its job, its just that the
> modules ask for java 8 compatibility so it can't allow those attributes.
>
> hope this helps,
> michael
>
>
>
> On 05.02.23 01:14, Brad Walker wrote:
> > I'm pulling my hair out trying to figure something out when I use the
> > @Deprecaed
> > annotation.
> >
> > For example, if I do the following in JarClassLoader.java, line 866
> >
> > /** Delete any temporary JARs we were holding on to.
> >   * Also close any other JARs in our list.
> >   */
> > *@Deprecated(since="9", forRemoval=true)*
> >  @Override
> >  protected void finalize() throws Throwable {
> >  super.finalize();
> >
> >  doCloseJar();
> >
> >  if (dead) {
> >  LOGGER.log(Level.FINE, "#21114: closing and deleting
> > temporary JAR {0}", file);
> >  if (file.isFile() && !file.delete()) {
> >  LOGGER.log(Level.FINE, "(but failed to delete {0})",
> > file);
> >  }
> >  }
> >  }
> >
> > I get the following error:
> >
> > -do-compile:
> > [depend] Deleted 12 out of date files in 0 seconds
> >   [nb-javac] Compiling 18 source files to
> > /home/bwalker/src/netbeans/platform/o.n.bootstrap/build/classes
> >   [nb-javac] Ignoring source, target and bootclasspath as release has
> been
> > set
> > [repeat]
> >
> /home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
> > error: cannot find symbol
> > [repeat] @Deprecated(since="9", forRemoval=true)
> > [repeat]^
> > [repeat]   symbol:   method since()
> > [repeat]   location: @interface Deprecated
> > [repeat]
> >
> /home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
> > error: cannot find symbol
> > [repeat] @Deprecated(since="9", forRemoval=true)
> > [repeat]   ^
> > [repeat]   symbol:   method forRemoval()
> > [repeat]   location: @interface Deprecated
> > [repeat] 2 errors
> >[nbmerge] Failed to build target: all-o.n.bootstrap
> >
> > Which says to me that it's compiling with javac for 1.8.
> >
> > Yet my path is set to use the version 17 of javac..
> >
> > [bwalker@fedora netbeans]$ javac -version
> > javac 17.0.5
> > [bwalker@fedora netbeans]$
> >
> > Ideas about where I should look for clues?
> >
> > -brad w.
> >
>
>


Re: use of Deprecated annotation error

2023-02-04 Thread Michael Bien

Hi Brad,

the @Deprecated annotation itself is old, however the attributes 
since/forRemoval are newer (probably JDK11 if I remember correctly).


This means that this will only work in modules which have their bytecode 
level set to 11 (there aren't many).


Javac of JDK 17 on your system is doing its job, its just that the 
modules ask for java 8 compatibility so it can't allow those attributes.


hope this helps,
michael



On 05.02.23 01:14, Brad Walker wrote:

I'm pulling my hair out trying to figure something out when I use the
@Deprecaed
annotation.

For example, if I do the following in JarClassLoader.java, line 866

/** Delete any temporary JARs we were holding on to.
  * Also close any other JARs in our list.
  */
*@Deprecated(since="9", forRemoval=true)*
 @Override
 protected void finalize() throws Throwable {
 super.finalize();

 doCloseJar();

 if (dead) {
 LOGGER.log(Level.FINE, "#21114: closing and deleting
temporary JAR {0}", file);
 if (file.isFile() && !file.delete()) {
 LOGGER.log(Level.FINE, "(but failed to delete {0})",
file);
 }
 }
 }

I get the following error:

-do-compile:
[depend] Deleted 12 out of date files in 0 seconds
  [nb-javac] Compiling 18 source files to
/home/bwalker/src/netbeans/platform/o.n.bootstrap/build/classes
  [nb-javac] Ignoring source, target and bootclasspath as release has been
set
[repeat]
/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
error: cannot find symbol
[repeat] @Deprecated(since="9", forRemoval=true)
[repeat]^
[repeat]   symbol:   method since()
[repeat]   location: @interface Deprecated
[repeat]
/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
error: cannot find symbol
[repeat] @Deprecated(since="9", forRemoval=true)
[repeat]   ^
[repeat]   symbol:   method forRemoval()
[repeat]   location: @interface Deprecated
[repeat] 2 errors
   [nbmerge] Failed to build target: all-o.n.bootstrap

Which says to me that it's compiling with javac for 1.8.

Yet my path is set to use the version 17 of javac..

[bwalker@fedora netbeans]$ javac -version
javac 17.0.5
[bwalker@fedora netbeans]$

Ideas about where I should look for clues?

-brad w.




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

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





use of Deprecated annotation error

2023-02-04 Thread Brad Walker
I'm pulling my hair out trying to figure something out when I use the
@Deprecaed
annotation.

For example, if I do the following in JarClassLoader.java, line 866

   /** Delete any temporary JARs we were holding on to.
 * Also close any other JARs in our list.
 */
*@Deprecated(since="9", forRemoval=true)*
@Override
protected void finalize() throws Throwable {
super.finalize();

doCloseJar();

if (dead) {
LOGGER.log(Level.FINE, "#21114: closing and deleting
temporary JAR {0}", file);
if (file.isFile() && !file.delete()) {
LOGGER.log(Level.FINE, "(but failed to delete {0})",
file);
}
}
}

I get the following error:

-do-compile:
   [depend] Deleted 12 out of date files in 0 seconds
 [nb-javac] Compiling 18 source files to
/home/bwalker/src/netbeans/platform/o.n.bootstrap/build/classes
 [nb-javac] Ignoring source, target and bootclasspath as release has been
set
   [repeat]
/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
error: cannot find symbol
   [repeat] @Deprecated(since="9", forRemoval=true)
   [repeat]^
   [repeat]   symbol:   method since()
   [repeat]   location: @interface Deprecated
   [repeat]
/home/bwalker/src/netbeans/platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:866:
error: cannot find symbol
   [repeat] @Deprecated(since="9", forRemoval=true)
   [repeat]   ^
   [repeat]   symbol:   method forRemoval()
   [repeat]   location: @interface Deprecated
   [repeat] 2 errors
  [nbmerge] Failed to build target: all-o.n.bootstrap

Which says to me that it's compiling with javac for 1.8.

Yet my path is set to use the version 17 of javac..

[bwalker@fedora netbeans]$ javac -version
javac 17.0.5
[bwalker@fedora netbeans]$

Ideas about where I should look for clues?

-brad w.


Re: building netbeans w/ different compiler

2023-02-04 Thread Ernie Rael

About using build.properties and nbjdk.home

There's a thread from last year, 
https://lists.apache.org/thread/4qvk880rkn4norzk7t9tt92ppmnf48kp, where 
it was not sufficient to set nbjdk.home, JAVA_HOME also had to be set.


I was using nbbuild/user.build.properties, not ~/.nbbuild.properties; 
don't know if that makes a difference.


-ernie

On 23/02/04 2:43 PM, Matthias Bläsing wrote:

Hi Brad,

Am Samstag, dem 04.02.2023 um 16:27 -0600 schrieb Brad Walker:

I can't figure out what options to use so that doing a build with Ant
compiles with a different compiler. I've looked all over the web page and
can't seem to find it there.

So 2 questions:

1 - Does compiling Netbeans out of the box continue to Java 8 as the
compiler?

You'll need JDK 11. Most modules still build for 8, but they use the
javac release flag to do that. I don't remember when that change was
made, but it was some time ago.


2 - What option would I pass to Ant in order for it to use a different
compiler?

Creating a file ".nbbuild.properties" in your home directory with the
contents:

nbjdk.home=

should do it.

Or you ensure, that that file das not exists/the property is not set
and put your target JDK as first element onto $PATH and set $JAVA_HOME
accordingly.

HTH

Matthias

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

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






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

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





Re: building netbeans w/ different compiler

2023-02-04 Thread Brad Walker
Hey Matthias,

You really got me thinking with this comment.. 8-)

On Sat, Feb 4, 2023 at 4:43 PM Matthias Bläsing
 wrote:

> > 1 - Does compiling Netbeans out of the box continue to Java 8 as the
> > compiler?
>
> You'll need JDK 11. Most modules still build for 8, but they use the
> javac release flag to do that. I don't remember when that change was
> made, but it was some time ago.
>

 I see the following in ide//editor/build.xml:





and I see the following in platform/o.n.bootstrap/build.xml:




















Is this what you are referring to?

And if so, why the difference as I'm trying to understand this.

-brad w.


Re: building netbeans w/ different compiler

2023-02-04 Thread Michael Bien

Hi Brad,

as Matthias said NetBeans requires at least JDK 11 for the build. In 
java you generally avoid swapping out the compiler since you can simply 
swap out the whole JDK - but I suppose that is what you meant by compiler.


The easiest way to achieve this is to make sure that only one JDK is on 
the PATH - or that the JDK you are interested in is in front of the PATH.


A simple script should do the trick:

export JAVA_HOME=/home/mbien/dev/java/jdk-19.0.2.7.1-corretto
export PATH=$JAVA_HOME/bin:$PATH

# or like Matthias suggested via your home directory - I want my clones 
to be self contained though when i test PRs, so I set it locally

echo nbjdk.home=$JAVA_HOME > nbbuild/user.build.properties

ant clean -q
ant build-nozip -Dcluster.config=full


there are also lots of tools which can manage java on the path, for 
example I could simply type


$ archlinux-java set java-19-openjdk

and the linux distribution does the rest. There is also sdkman and 
probably dozens more.


best regards,

michael

On 04.02.23 23:27, Brad Walker wrote:

I can't figure out what options to use so that doing a build with Ant
compiles with a different compiler. I've looked all over the web page and
can't seem to find it there.

So 2 questions:

1 - Does compiling Netbeans out of the box continue to Java 8 as the
compiler?
2 - What option would I pass to Ant in order for it to use a different
compiler?

-brad w.




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

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





Re: building netbeans w/ different compiler

2023-02-04 Thread Matthias Bläsing
Hi Brad,

Am Samstag, dem 04.02.2023 um 16:27 -0600 schrieb Brad Walker:
> I can't figure out what options to use so that doing a build with Ant
> compiles with a different compiler. I've looked all over the web page and
> can't seem to find it there.
> 
> So 2 questions:
> 
> 1 - Does compiling Netbeans out of the box continue to Java 8 as the
> compiler?

You'll need JDK 11. Most modules still build for 8, but they use the
javac release flag to do that. I don't remember when that change was
made, but it was some time ago.

> 2 - What option would I pass to Ant in order for it to use a different
> compiler?

Creating a file ".nbbuild.properties" in your home directory with the
contents:

nbjdk.home=

should do it.

Or you ensure, that that file das not exists/the property is not set
and put your target JDK as first element onto $PATH and set $JAVA_HOME
accordingly.

HTH

Matthias

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

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





building netbeans w/ different compiler

2023-02-04 Thread Brad Walker
I can't figure out what options to use so that doing a build with Ant
compiles with a different compiler. I've looked all over the web page and
can't seem to find it there.

So 2 questions:

1 - Does compiling Netbeans out of the box continue to Java 8 as the
compiler?
2 - What option would I pass to Ant in order for it to use a different
compiler?

-brad w.