Re: Netbeans 22 does not allow JDK 1.7 or 1.8

2024-03-01 Thread Michael Bien

On 01.03.24 22:56, Noel Abela wrote:

Thanks again for your input.

As you can see from the  attached screenshot I am getting the same 
error for Java 8.


what Java distribution is this you tried to add? if its the one from the 
link you posted it would be a JRE I believe. Oracle has a separate page 
for JDK downloads somewhere. You cant use JREs to build programs.



But thanks to your suggestion, I managed to install 8 anyway by 
downloading it from within the platform manager itself.


cool!




If I build my application with a higher JDK their java will not allow 
them to run my application.


almost. On later JDKs you can use -release 11 for example to build your 
project against a specific version which can be lower than the JDK 
version. JDK 8 doesn't have that yet, so you pretty much have to build 
on JDK 8 to be sure that you don't use API from a later version by 
accident - or have very good test coverage.





As for the version issue, I am not sure if I am explaining myself 
well. Below is the link where one can install the latest version of 
Java which is 8. This is what the users of my application will do 
before running my application.



JREs still exist from various vendors, e.g:

https://adoptium.net/temurin/releases/?package=jre=21

https://www.azul.com/downloads/?version=java-21-lts=jre#zulu

...

simply point your users to a different link


I will venture an answer to my own question of why java 8 is the 
latest jre available. Is it maybe because jlink started from JDK9? If 
so, then they are assuming that everyone will be using jlink which 
might not be the case.


Sun was interested in the desktop, Oracle not so much. I believe JRE 8 
is the last offered JRE from Oracle. The way how programs are installed 
changed too. Today it usually works over app stores where everything is 
typically included in the download. Having a JRE requirement is a bit 
dated. Java 8 is a decade old by now.


-mbien

-
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



Re: Netbeans 22 does not allow JDK 1.7 or 1.8

2024-03-01 Thread Michael Bien

On 01.03.24 18:24, Noel Abela wrote:
I am confused about all these versions. How come if you download the 
latest JRE from Oracle


this explains it. The platform manager expects a JDK, not a JRE. The 
concept of JRE is a bit dated and no longer well defined since the 
introduction of jlink, which allows to create your own JRE if needed.


I thought we added a better error msg in case a user tries to register a 
JRE - apparently not ;)




you get Java 8 since the JDK went all the way up to 21?


yeah. so here is the summary:

 - NetBeans 21 requires JDK 11, 17, or 21 to run as you can see on the 
download page.


 - You should be able to register JDK 8 or later using the java 
platform manager and use it for your projects.


 - 1.7 won't be possible anymore since the editor of NB relies on a 
recent version of javac (which is bundled with NB), and javac itself 
does no longer support the Java 7 target (8 works fine)



How come if you download the latest... 


The Platform Manager itself can download JDKs.

This community maintained website might also help to find a version from 
a vendor you prefer: https://javaalmanac.io/


If you install a JDK using tools like sdkman or a regular repository on 
linux, NB should automatically add it to the platform manager since it 
scans some well-known directories.


best regards,

-mbien



On 01/03/2024 16:15, Michael Bien wrote:
NetBeans 21 supports projects which use JDKs in the rage 8-21 with 
limited support for early access dev builds 22, 23 etc.


javac itself dropped support for the 1.7 target in Java 20.

So your best bet would be to try NetBeans 17 which used nb-javac 
based on JDK 19. Although I can't promise that this will work since I 
don't think anyone tested anything with Java 7 for quite some time.


-mbien

On 01.03.24 10:32, Noel Abela wrote:

I have just installed Nebeans 22 which is using JDK 21.
I need to maintain a desktop application which is on JDK 1.7 but 
when I attempt to add this JDK and even JDK 1.8, Netbeans gives the 
following error ...



"Cannot detect and install the selected platform. The Java or javac 
may not be executable."


I have read in other forums that this was a bug way back in version 
10 or 11.

I would have imagined that this would have been solved by version 22.
Does anyone know some fix or workaround for this?

-
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







-
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



Re: Netbeans 22 does not allow JDK 1.7 or 1.8

2024-03-01 Thread Noel Abela

Thank you for your input.

8-21 you say? But i tried Java 8 too and it gave the same error.

I am confused about all these versions. How come if you download the 
latest JRE from Oracle you get Java 8 since the JDK went all the way up 
to 21?


On 01/03/2024 16:15, Michael Bien wrote:
NetBeans 21 supports projects which use JDKs in the rage 8-21 with 
limited support for early access dev builds 22, 23 etc.


javac itself dropped support for the 1.7 target in Java 20.

So your best bet would be to try NetBeans 17 which used nb-javac based 
on JDK 19. Although I can't promise that this will work since I don't 
think anyone tested anything with Java 7 for quite some time.


-mbien

On 01.03.24 10:32, Noel Abela wrote:

I have just installed Nebeans 22 which is using JDK 21.
I need to maintain a desktop application which is on JDK 1.7 but when 
I attempt to add this JDK and even JDK 1.8, Netbeans gives the 
following error ...



"Cannot detect and install the selected platform. The Java or javac 
may not be executable."


I have read in other forums that this was a bug way back in version 
10 or 11.

I would have imagined that this would have been solved by version 22.
Does anyone know some fix or workaround for this?

-
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






-
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



No new project from "Java Project from existing Sources"

2024-03-01 Thread Ulf Zibis

Hi,

I have old java sources, which I want to work on with NetBeans 21.

Location of the existing sources is:
~/Projects/Palm/NetbeansProjects/DesktopFiles_src/

Location for the new project is:
~/Projects/Palm/NetbeansProjects/DesktopFiles/

So these are separate paths, but I get:
! Project Folder has to be located outside of the folder containing packages.

So what I'm doing wrong?

-Ulf


-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Ulf Zibis



Am 01.03.24 um 15:24 schrieb Michael Bien:

NetBeans ships with nb-javac preinstalled as regular module, if you don't 
change anything it should just work. Start NB, open/create a project and the 
right modules will activate.


You want to say, that I do not have to activate "Java SE" plugin manually, 
before opening or creating a java project?
It will be activated automatically?

The message about nb-javac was after I tried to create a java project from 
existing sources, which didn't work, the dialogue didn't finish, so I had to 
cancel it. This is maybe of interest.

From a fresh install with all configs, cache and user dir deleteted, I get 
following messages:
$ /usr/bin/netbeans
WARNING: package com.apple.eio not in java.desktop
WARNING: package jdk.internal.opt not in jdk.internal.opt
WARNING: package com.sun.java.swing.plaf.windows not in java.desktop
WARNING: package com.apple.laf not in java.desktop
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by 
org.netbeans.TopSecurityManager 
(file:/usr/lib/apache-netbeans/platform/lib/boot.jar)
WARNING: Please consider reporting this to the maintainers of 
org.netbeans.TopSecurityManager
WARNING: System::setSecurityManager will be removed in a future release

Should I worry about that?

-Ulf


-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Ulf Zibis



Am 01.03.24 um 15:24 schrieb Michael Bien:


there are several red flags here which might cause you problems in future:

 - Don't start NB with root rights. Subsequent starts will likely not be able 
to write to cache/log folders.

I used `sudo -H` to avoid this.


  - The "force plugin install into shared directories" is not a good idea

Why is it provided? I prefer to install binaries under binaries locations, 
which is /usr/lib here. /home is for data and configs. Helps to minimize backup 
footprint an allows all users to profit from the installed binaries.

(esp with root rights)

Under which conditions it is possible to install in shared directories without 
root rights?

and is likely the original cause why nb-javac couldn't be found if you done 
that in past


It was first time I installed NB 21.


NetBeans ships with nb-javac preinstalled as regular module, if you don't 
change anything it should just work. Start NB, open/create a project and the 
right modules will activate.


Unfortunately this didn't happen at me.

-Ulf


-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Ulf Zibis


Am 01.03.24 um 15:51 schrieb Neil C Smith:

You can replicate running with a clean userdir by running

netbeans --userdir /tmp/testuserdir1

Thanks for the hint.


Sorry, should have been clearer - I meant NetBeans packaging.  Between
ASF and community options there's zip, deb (x2), appimage and snap you
could be using on Ubuntu.


I used:

sudo apt install ./apache-netbeans_21-1_all.deb

-Ulf


Re: Netbeans 22 does not allow JDK 1.7 or 1.8

2024-03-01 Thread Michael Bien
NetBeans 21 supports projects which use JDKs in the rage 8-21 with 
limited support for early access dev builds 22, 23 etc.


javac itself dropped support for the 1.7 target in Java 20.

So your best bet would be to try NetBeans 17 which used nb-javac based 
on JDK 19. Although I can't promise that this will work since I don't 
think anyone tested anything with Java 7 for quite some time.


-mbien

On 01.03.24 10:32, Noel Abela wrote:

I have just installed Nebeans 22 which is using JDK 21.
I need to maintain a desktop application which is on JDK 1.7 but when 
I attempt to add this JDK and even JDK 1.8, Netbeans gives the 
following error ...



"Cannot detect and install the selected platform. The Java or javac 
may not be executable."


I have read in other forums that this was a bug way back in version 10 
or 11.

I would have imagined that this would have been solved by version 22.
Does anyone know some fix or workaround for this?

-
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




-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Neil C Smith
On Fri, 1 Mar 2024 at 14:44, Ulf Zibis  wrote:
> nb-javac is included in NetBeans since NB13, so you should not see
> this dialog unless you've deliberately disabled this support and run
> on an older JDK.
>
> This I assumed too, so I'm wondering about my ecperience.

So am I!  If you can find steps that reproduce what you saw it would
be good to know.  I just tried with a local JDK 18 and all seems fine.

You can replicate running with a clean userdir by running

netbeans --userdir /tmp/testuserdir1


> Also, include the package you're using - there are multiple options on
> Ubuntu, which might have an effect on what's happening.
>
> I used package openjdk-18-jdk

Sorry, should have been clearer - I meant NetBeans packaging.  Between
ASF and community options there's zip, deb (x2), appimage and snap you
could be using on Ubuntu.

Best wishes,

Neil

-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Ulf Zibis


Am 01.03.24 um 15:25 schrieb Neil C Smith:

The above two steps might have been what fixed it.  Have you been
using NetBeans for a while and copying forward configuration and
plugins?

No, I didn't import old configuration and I deleted ~/.cache/netbeans and 
~/.netbeans/21


nb-javac is included in NetBeans since NB13, so you should not see
this dialog unless you've deliberately disabled this support and run
on an older JDK.

This I assumed too, so I'm wondering about my ecperience.


Also, include the package you're using - there are multiple options on
Ubuntu, which might have an effect on what's happening.


I used package openjdk-18-jdk

-Ulf



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Michael Bien

On 01.03.24 14:43, Ulf Zibis wrote:

Am 29.02.24 um 22:12 schrieb Geertjan Wielenga:
The Apache NetBeans 21 binary releases require JDK 11+, and 
officially supports running on JDK 11, 17 and 21.


Thanks for the info.

In the meantime I solved the problem still using JDK 18 as follows.

- deleted user config data and reinstalled NetBeans
- started NB under root
- configured plugins  to shared directory
- activated Java SE module, which also installed the profiler
- started NB as user
- again activated Java SE module
- Restart. All is fine !!!

Don't know, if that is a good workaround.

-Ulf 


there are several red flags here which might cause you problems in future:

 - Don't start NB with root rights. Subsequent starts will likely not 
be able to write to cache/log folders.


 - The "force plugin install into shared directories" is not a good 
idea (esp with root rights) and is likely the original cause why 
nb-javac couldn't be found if you done that in past


 - Run NB on supported JDKs, there are usually 2-3 LTS versions 
supported for every NB release to make this easier. There are also 
community bundles available from the download page which contain a JDK. 
If you don't want to use those, this page might help to find the right 
JDKs download: https://javaalmanac.io/jdk/21/



NetBeans ships with nb-javac preinstalled as regular module, if you 
don't change anything it should just work. Start NB, open/create a 
project and the right modules will activate.


btw to reset NB completely, all you have to do is to follow the note on 
the readme: 
https://github.com/apache/netbeans?tab=readme-ov-file#log-config-and-cache-locations


-mbien


-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Neil C Smith
On Fri, 1 Mar 2024 at 13:43, Ulf Zibis  wrote:
> In the meantime I solved the problem still using JDK 18 as follows.
>
> - deleted user config data and reinstalled NetBeans
...
> - Restart. All is fine !!!
>
> Don't know, if that is a good workaround.

The above two steps might have been what fixed it.  Have you been
using NetBeans for a while and copying forward configuration and
plugins?

nb-javac is included in NetBeans since NB13, so you should not see
this dialog unless you've deliberately disabled this support and run
on an older JDK.  If you see it again, please report an issue.

Also, include the package you're using - there are multiple options on
Ubuntu, which might have an effect on what's happening.

Best wishes,

Neil

-
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



Re: Missing nb-javac plugin in NetBeans IDE 21

2024-03-01 Thread Ulf Zibis


Am 29.02.24 um 22:12 schrieb Geertjan Wielenga:

The Apache NetBeans 21 binary releases require JDK 11+, and officially supports 
running on JDK 11, 17 and 21.


Thanks for the info.

In the meantime I solved the problem still using JDK 18 as follows.

- deleted user config data and reinstalled NetBeans
- started NB under root
- configured plugins  to shared directory
- activated Java SE module, which also installed the profiler
- started NB as user
- again activated Java SE module
- Restart. All is fine !!!

Don't know, if that is a good workaround.

-Ulf

Netbeans 22 does not allow JDK 1.7 or 1.8

2024-03-01 Thread Noel Abela

I have just installed Nebeans 22 which is using JDK 21.
I need to maintain a desktop application which is on JDK 1.7 but when I 
attempt to add this JDK and even JDK 1.8, Netbeans gives the following 
error ...



"Cannot detect and install the selected platform. The Java or javac may 
not be executable."


I have read in other forums that this was a bug way back in version 10 
or 11.

I would have imagined that this would have been solved by version 22.
Does anyone know some fix or workaround for this?

-
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



Re: Using Mockito with Netbeans

2024-03-01 Thread Ulrich Mayring
Brother, you're working for the wrong company. Adding fake/senseless 
tests decreases the quality of the software. As a developer you are not 
allowed to do that.


Testing the data layer against the database is the right thing to do 
here and you can do it in an integration test and also use JUnit for 
that. Then you can add the coverage produced by the integration tests to 
the coverage from the unit tests.


As for the database, if you have a containerized application then it is 
easy to just use the database container you have anyway. Alternatively 
you could fire up an in-process in-memory database like H2 and run your 
integration tests against that.


Ulrich

Am 29.02.24 um 22:43 schrieb Greenberg, Gary:

Yes, I do need to mock CRUD operations without accessing the database.
As I said, code was debugged and tested with the database, but to 
comply with the company policy
I do need to add these "fake" unit tests. I haven't used Mockito for 
about 10 years and don't want to spend much time
to refresh my knowledge. I do hope that NB have some mocking features 
that will help me.


*From:* Leo Donahue 
*Sent:* Thursday, February 29, 2024 1:29 PM
*Cc:* NetBeans Mailing List 
*Subject:* Re: Using Mockito with Netbeans

On Thu, Feb 29, 2024, 13:33 Greenberg,Gary  
wrote:


I already have all DTO and DAO classes written and debugged.
However, per company policy, unit test coverage must be no less than
75%.
Right now, I have it less than 30%, because this is database driven
project and to comply, I need to create
tests mocking database operations.


 >>mocking database operations

Do you mean that you need to mock CRUD in a unit test?

If you create mock data in the test, you control the mock data which 
means you're testing a hard coded value or testing for null and the 
database is never used.


Is that valuable?

Suppose you unit test pinging the database, as in select something and 
it fails because the database is down, or today no permissions were 
granted to your test account or your test user password expired... now 
what.  The unit test says something is broken but it may not be in your 
control.



*From:* Pieter van den Hombergh mailto:pieter.van.den.hombe...@gmail.com>>
*Sent:* Thursday, February 29, 2024 7:49 AM
*Cc:* NetBeans Mailing List mailto:users@netbeans.apache.org>>
*Subject:* Re: Using Mockito with Netbeans
generated tests from existing classes sounds like testing after the
fact.

Then I would consider generating the DAOs from information
available, like the database schema or the DTO classes which should
be of the record type.

but if you still insist, make the DAO tests inherit from a TestBase
class that configures the mocked data source.
If the DAO accepts the data source or a connection as dependency in
the injection sense, you are good to go and can verify the proper
use of the dependency by the DAO, which is the purpose of mocking.

I may find some time tomorrow to come up with a more elaborate answer.


Kind regards,
Pieter van den Hombergh.


met vriendelijke groet
Pieter van den Hombergh

Op do 29 feb 2024 01:40 schreef Greenberg, Gary
:

I am quite used to generate unit tests for my code using
Netbeans Tools->Create/Update Tests. JUnit is great.
However, now I need to create tests for some DAO classes where I
will need to mock database access.
I plan to use Mockito for that.  Does Netbeans have any features
automating Mockito test creation?

*Gary Greenberg*

Staff Software Engineer



--
iSYS Software GmbH

Ulrich Mayring | Full Stack Developer
Technology Lab / R

Tel: +49 (0) 89 46 23 28-0 | Fax  +49 (0) 89 46 23 28-14
email: ulrich.mayr...@isys.de

Grillparzerstraße 10 | D-81675 München
www.isys.de

Sitz der Gesellschaft: München | HRB 111760
Geschäftsführer: Stefan Fischer und Max Haller

-
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