You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Peter Toye <ne...@ptoye.com> on 2019/09/20 14:44:01 UTC

Java project now needs classpaths to run it

Having just moved from NB version 8 to 11.1 there seems to have been a change in the command line needed to run a project.

The OS is Windows 7 Home.

The project has two external libraries: one in the Java modules in the NetBeans 11 directory, and one of my own. In version 8 it was possible to run the program with a command line like
 
   java -jar program.jar
   
but this no longer works, and I have to put in a command line like

  java -cp library paths program.jar
  
which is a pain, as I can't automate that into a batch file.

Is there any way of getting the libraries (or references to them) included in the jar file? The properties|Libraries|Run tab shows that the classpaths for Compiling Sources and Compiled Sources are included (at least as I understand the symbols on that page). Does the "Build Dependencies" tickbox have any significance here? The lack of a help file means that I can't find out what most of the window items actually mean.

As a rider to this question, there seems to be two small bugs in the Ant script which produces the command line for running the project :

To run this application from the command line without Ant, try:

C:\Program Files\Java\jdk-12.0.1/bin/java -cp C:\Program Files\NetBeans 11\netbeans\java\modules\ext\AbsoluteLayout.jar;D:\Peter\Netbeans\Partitions511\dist\Partitions511.jar;D:\Peter\Netbeans\KillerSudoku11\dist\KillerSudoku11.jar com.ptoye.TestKiller.TestKiller


1) In Windows, the Java executable and Netbeans are in the "Program Files" or "Program Files (x86)" folder. This should have quotes round it to run successfully.

2) In NB 11.1, the output mentions "Netbeans 11" - Shouldn't this be C:\Program Files\NetBeans-11.1?
 
Regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Eric,

Thanks. I'm Windows-based so the details of *nix flavours rather pass me by.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 9:02:34 PM, you wrote:


It's pretty common-place (at least in *nix) for commands to support both GNU style and POSIX style arguments with both alternatives for most things. 
From running "java --help", I learn that
--module will do the same as -m
and
-p is an alternative to --module-path


On 10/21/19 5:56 AM, Peter Toye wrote:

Re: Java project now needs classpaths to run it

Why the Java designer can't just stick to a single syntax is beyond me.....

Re: Java project now needs classpaths to run it

Posted by "Eric J. Schwarzenbach" <er...@wrycan.com>.
It's pretty common-place (at least in *nix) for commands to support both 
GNU style and POSIX style arguments with both alternatives for most things.

 From running "java --help", I learn that

--module will do the same as -m

and

-p is an alternative to --module-path



On 10/21/19 5:56 AM, Peter Toye wrote:
> Re: Java project now needs classpaths to run it
> Why the Java designer can't just stick to a single syntax is beyond 
> me.....
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Much happier :-)>  . Many thanks. I owe you another beer.... Where are you based?

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 4:15:08 PM, you wrote:


https://issues.apache.org/jira/browse/NETBEANS-3260

Hope the above investigation makes you happy. :-)

Gj

On Mon, Oct 21, 2019 at 4:07 PM Geertjan Wielenga <ge...@apache.org> wrote:


It is copied and pasted from there.

Gj

On Mon, 21 Oct 2019 at 16:06, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Fine. I agree. A shame that OpenJDK don't put this on the mailing list page you sent me.....


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 2:53:18 PM, you wrote:


Who is “they”? Why are thousands of people able to write to that mailing list apparently without a problem.

https://mail.openjdk.java.net/mailman/listinfo/discuss

Go to the above and sign up, ignoring this topic on mailing lists now.

Gj


On Mon, 21 Oct 2019 at 15:48, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I wasn't expecting you to, but I hope you can see my frustration. I mail OpenJDK at the address they give you, and get an auto-reject telling me to contact that same address. This is for information - just don't bother trying to contact OpenJDK.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 12:56:31 PM, you wrote:





I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is where I’m going to draw a line: I am not going to help you subscribe to a mailing list.

Gj

On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Agreed - but the address they give is the one that's auto-rejected!


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 11:35:13 AM, you wrote:


You’ll need to subscribe to the mailing lists you want to write to.

Gj

On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Thanks. I wrote to the mailing list address and got the following answer:

  You are not allowed to post to this mailing list, and your message has
  been automatically rejected.  If you think that your messages are
  being rejected in error, contact the mailing list owner at
  mailman-owner@openjdk.java.net.
 
But that was the address that I mailed! A but recursive. Something wrong up at openJDK methinks. I've tried another address....

I'll file an issue in JIRA.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
https://issues.apache.org/jira/browse/NETBEANS-3260

Hope the above investigation makes you happy. :-)

Gj

On Mon, Oct 21, 2019 at 4:07 PM Geertjan Wielenga <ge...@apache.org>
wrote:

>
> It is copied and pasted from there.
>
> Gj
>
> On Mon, 21 Oct 2019 at 16:06, Peter Toye <ne...@ptoye.com> wrote:
>
>> Dear Geertjan,
>>
>> Fine. I agree. A shame that OpenJDK don't put this on the mailing list
>> page you sent me.....
>>
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>> -------------------------
>> Monday, October 21, 2019, 2:53:18 PM, you wrote:
>>
>>
>> Who is “they”? Why are thousands of people able to write to that mailing
>> list apparently without a problem.
>>
>> https://mail.openjdk.java.net/mailman/listinfo/discuss
>>
>> Go to the above and sign up, ignoring this topic on mailing lists now.
>>
>> Gj
>>
>>
>> On Mon, 21 Oct 2019 at 15:48, Peter Toye <ne...@ptoye.com> wrote:
>>
>> Dear Geertjan,
>>
>> I wasn't expecting you to, but I hope you can see my frustration. I mail
>> OpenJDK at the address they give you, and get an auto-reject telling me to
>> contact that same address. This is for information - just don't bother
>> trying to contact OpenJDK.
>>
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>> -------------------------
>> Monday, October 21, 2019, 12:56:31 PM, you wrote:
>>
>>
>>
>>
>>
>> I don’t know who the ‘they’ are you’re referring to, but I’m sorry this
>> is where I’m going to draw a line: I am not going to help you subscribe to
>> a mailing list.
>>
>> Gj
>>
>> On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:
>>
>> Dear Geertjan,
>>
>> Agreed - but the address they give is the one that's auto-rejected!
>>
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>> -------------------------
>> Monday, October 21, 2019, 11:35:13 AM, you wrote:
>>
>>
>> You’ll need to subscribe to the mailing lists you want to write to.
>>
>> Gj
>>
>> On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:
>>
>> Dear Geertjan,
>>
>> Thanks. I wrote to the mailing list address and got the following answer:
>>
>>   You are not allowed to post to this mailing list, and your message has
>>   been automatically rejected.  If you think that your messages are
>>   being rejected in error, contact the mailing list owner at
>>   mailman-owner@openjdk.java.net.
>>
>> But that was the address that I mailed! A but recursive. Something wrong
>> up at openJDK methinks. I've tried another address....
>>
>> I'll file an issue in JIRA.
>>
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
It is copied and pasted from there.

Gj

On Mon, 21 Oct 2019 at 16:06, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> Fine. I agree. A shame that OpenJDK don't put this on the mailing list
> page you sent me.....
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 2:53:18 PM, you wrote:
>
>
> Who is “they”? Why are thousands of people able to write to that mailing
> list apparently without a problem.
>
> https://mail.openjdk.java.net/mailman/listinfo/discuss
>
> Go to the above and sign up, ignoring this topic on mailing lists now.
>
> Gj
>
>
> On Mon, 21 Oct 2019 at 15:48, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> I wasn't expecting you to, but I hope you can see my frustration. I mail
> OpenJDK at the address they give you, and get an auto-reject telling me to
> contact that same address. This is for information - just don't bother
> trying to contact OpenJDK.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 12:56:31 PM, you wrote:
>
>
>
>
>
> I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is
> where I’m going to draw a line: I am not going to help you subscribe to a
> mailing list.
>
> Gj
>
> On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Agreed - but the address they give is the one that's auto-rejected!
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 11:35:13 AM, you wrote:
>
>
> You’ll need to subscribe to the mailing lists you want to write to.
>
> Gj
>
> On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Thanks. I wrote to the mailing list address and got the following answer:
>
>   You are not allowed to post to this mailing list, and your message has
>   been automatically rejected.  If you think that your messages are
>   being rejected in error, contact the mailing list owner at
>   mailman-owner@openjdk.java.net.
>
> But that was the address that I mailed! A but recursive. Something wrong
> up at openJDK methinks. I've tried another address....
>
> I'll file an issue in JIRA.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Fine. I agree. A shame that OpenJDK don't put this on the mailing list page you sent me.....

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 2:53:18 PM, you wrote:


Who is “they”? Why are thousands of people able to write to that mailing list apparently without a problem.

https://mail.openjdk.java.net/mailman/listinfo/discuss

Go to the above and sign up, ignoring this topic on mailing lists now.

Gj


On Mon, 21 Oct 2019 at 15:48, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I wasn't expecting you to, but I hope you can see my frustration. I mail OpenJDK at the address they give you, and get an auto-reject telling me to contact that same address. This is for information - just don't bother trying to contact OpenJDK.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 12:56:31 PM, you wrote:




I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is where I’m going to draw a line: I am not going to help you subscribe to a mailing list.

Gj

On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Agreed - but the address they give is the one that's auto-rejected!


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 11:35:13 AM, you wrote:


You’ll need to subscribe to the mailing lists you want to write to.

Gj

On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Thanks. I wrote to the mailing list address and got the following answer:

  You are not allowed to post to this mailing list, and your message has
  been automatically rejected.  If you think that your messages are
  being rejected in error, contact the mailing list owner at
  mailman-owner@openjdk.java.net.
 
But that was the address that I mailed! A but recursive. Something wrong up at openJDK methinks. I've tried another address....

I'll file an issue in JIRA.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
Who is “they”? Why are thousands of people able to write to that mailing
list apparently without a problem.

https://mail.openjdk.java.net/mailman/listinfo/discuss

Go to the above and sign up, ignoring this topic on mailing lists now.

Gj


On Mon, 21 Oct 2019 at 15:48, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> I wasn't expecting you to, but I hope you can see my frustration. I mail
> OpenJDK at the address they give you, and get an auto-reject telling me to
> contact that same address. This is for information - just don't bother
> trying to contact OpenJDK.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 12:56:31 PM, you wrote:
>
>
>
>
> I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is
> where I’m going to draw a line: I am not going to help you subscribe to a
> mailing list.
>
> Gj
>
> On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Agreed - but the address they give is the one that's auto-rejected!
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 11:35:13 AM, you wrote:
>
>
> You’ll need to subscribe to the mailing lists you want to write to.
>
> Gj
>
> On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Thanks. I wrote to the mailing list address and got the following answer:
>
>   You are not allowed to post to this mailing list, and your message has
>   been automatically rejected.  If you think that your messages are
>   being rejected in error, contact the mailing list owner at
>   mailman-owner@openjdk.java.net.
>
> But that was the address that I mailed! A but recursive. Something wrong
> up at openJDK methinks. I've tried another address....
>
> I'll file an issue in JIRA.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

I wasn't expecting you to, but I hope you can see my frustration. I mail OpenJDK at the address they give you, and get an auto-reject telling me to contact that same address. This is for information - just don't bother trying to contact OpenJDK.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 12:56:31 PM, you wrote:



I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is where I’m going to draw a line: I am not going to help you subscribe to a mailing list.

Gj

On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Agreed - but the address they give is the one that's auto-rejected!


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 11:35:13 AM, you wrote:


You’ll need to subscribe to the mailing lists you want to write to.

Gj

On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Thanks. I wrote to the mailing list address and got the following answer:

  You are not allowed to post to this mailing list, and your message has
  been automatically rejected.  If you think that your messages are
  being rejected in error, contact the mailing list owner at
  mailman-owner@openjdk.java.net.
 
But that was the address that I mailed! A but recursive. Something wrong up at openJDK methinks. I've tried another address....

I'll file an issue in JIRA.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
I don’t know who the ‘they’ are you’re referring to, but I’m sorry this is
where I’m going to draw a line: I am not going to help you subscribe to a
mailing list.

Gj

On Mon, 21 Oct 2019 at 13:54, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> Agreed - but the address they give is the one that's auto-rejected!
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 11:35:13 AM, you wrote:
>
>
> You’ll need to subscribe to the mailing lists you want to write to.
>
> Gj
>
> On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Thanks. I wrote to the mailing list address and got the following answer:
>
>   You are not allowed to post to this mailing list, and your message has
>   been automatically rejected.  If you think that your messages are
>   being rejected in error, contact the mailing list owner at
>   mailman-owner@openjdk.java.net.
>
> But that was the address that I mailed! A but recursive. Something wrong
> up at openJDK methinks. I've tried another address....
>
> I'll file an issue in JIRA.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Agreed - but the address they give is the one that's auto-rejected!

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 11:35:13 AM, you wrote:


You’ll need to subscribe to the mailing lists you want to write to.

Gj

On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Thanks. I wrote to the mailing list address and got the following answer:

  You are not allowed to post to this mailing list, and your message has
  been automatically rejected.  If you think that your messages are
  being rejected in error, contact the mailing list owner at
  mailman-owner@openjdk.java.net.
 
But that was the address that I mailed! A but recursive. Something wrong up at openJDK methinks. I've tried another address....

I'll file an issue in JIRA.


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
You’ll need to subscribe to the mailing lists you want to write to.

Gj

On Mon, 21 Oct 2019 at 12:31, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> Thanks. I wrote to the mailing list address and got the following answer:
>
>   You are not allowed to post to this mailing list, and your message has
>   been automatically rejected.  If you think that your messages are
>   being rejected in error, contact the mailing list owner at
>   mailman-owner@openjdk.java.net.
>
> But that was the address that I mailed! A but recursive. Something wrong
> up at openJDK methinks. I've tried another address....
>
> I'll file an issue in JIRA.
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 10:59:35 AM, you wrote:
>
>
> File an issue with steps, and we can investigate and see where to fix that
> output.
>
> If it still gives problems, can you say what those problems are, or how
> can we help?
>
> Gj
>
> On Mon, 21 Oct 2019 at 11:56, Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> Thanks again. I'd found that page, and the code I produced was a copy of
> the code there. It seems that  a "-m" option is needed to indicate the main
> class.
> It still gives problems, but I'll try your suggestion of trying to join
> the openJDK mailing list.
>
> So the Ant script output now has three bugs:
>
>
>    1. No double quotes round the Java executable directory "Program Files"
>    2. "-module-path" should read "--module-path"
>    3. "-m" needed before the main class.
>
>
>
>
> Why the Java designer can't just stick to a single syntax is beyond me.....
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 9:07:54 AM, you wrote:
>
>
> https://openjdk.java.net/projects/jigsaw/quick-start
>
> That should help, it includes the java command line syntax you're looking
> for.
>
> Gj
>
> On Sun, Oct 20, 2019 at 11:21 PM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
> To be honest, I'd love to help but I'm not going to spend any time
> guessing about your application, you're going to need to provide a way to
> access it, e.g., put it on GitHub, so that it can be downloaded, e.g.,
> sorry, "import com.ptoye.astro.World", no idea what that is, and please do
> not try to explain -- just take your application and put it on GitHub or
> somewhere else (please not as a ZIP file) and then I'll be happy to help.
>
> Indeed, yes, it would be very useful to everyone if you'd join the openjdk
> mailing lists and explain the problems you're having running java on the
> command line -- they need to know that otherwise they'll never hear from
> you and never make it work the way you'd like.
>
> Gj
>
>
>
> On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> OK, I've read up on modules and written my first Hello World program which
> compiles and runs fine using NetBeans. However, it doesn't run from a
> command line, even after I've removed the mistakes in the Ant-generated
> suggestion:
>
> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
> Error: Could not find or load main class com.ptoye.greetings.Main
> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>
> The main class is:
>
> package com.ptoye.greetings;
> ????import com.ptoye.astro.World;
> ??public class Main {??
>         public static void main(String[] args) {
> ??            System.out.format("Greetings %s!%n", World.name());
> ??        }
> ??}??
>
> Where does one go from here? I'm using the Oracle version of Java, Would
> OpenJDK make any difference? AFAICS  it's the same.
>
> Thanks for the mailing list link. I looked at them but they all seem to be
> oriented towards people developing OpenJDK rather than users. There isn't a
> "support" or "help" link on the OpenJDK site.
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>
>
>
>
>
>
>
>
> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> I agree that the "java" command has nothing to do with Netbeans. I'll try
> to be more explicit:
>
> I have a project which dates back to about 2006 and has a main class which
> I'll call A. This uses a separate class B which I developed separately. I
> included B as a library using A's project properties.
>
> Using Netbeans 8 (and earlier) it was possible to run the project using a
> command line like
>   java -jar A.jar
> and the program ran. The Java version was 1.8. The path to the Java
> executable is in my PATH.
>
> Earlier this year I wanted to develop it further, and decided to move to
> the latest version of NetBeans (11.1) and Java (12). Now the command line
> as given in the build output is
>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
> *directory\*B.jar *classpath.*A
>
> My main point is that I don't understand how or why this has changed.
>
> https://openjdk.java.net/projects/jigsaw/
>
> There is now a module system in Java, meaning that there is now a module
> path and a class path. That was not there in JDK 8 and is now there since
> then.
>
> Can you join the Java mailing lists and discuss further there:
> https://mail.openjdk.java.net/mailman/listinfo
>
> Gj
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Thanks. I wrote to the mailing list address and got the following answer:

  You are not allowed to post to this mailing list, and your message has
  been automatically rejected.  If you think that your messages are
  being rejected in error, contact the mailing list owner at
  mailman-owner@openjdk.java.net.
  
But that was the address that I mailed! A but recursive. Something wrong up at openJDK methinks. I've tried another address....

I'll file an issue in JIRA.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 10:59:35 AM, you wrote:


File an issue with steps, and we can investigate and see where to fix that output.

If it still gives problems, can you say what those problems are, or how can we help?

Gj

On Mon, 21 Oct 2019 at 11:56, Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

Thanks again. I'd found that page, and the code I produced was a copy of the code there. It seems that  a "-m" option is needed to indicate the main class.
It still gives problems, but I'll try your suggestion of trying to join the openJDK mailing list.

So the Ant script output now has three bugs:

No double quotes round the Java executable directory "Program Files"
"-module-path" should read "--module-path"
"-m" needed before the main class.


Why the Java designer can't just stick to a single syntax is beyond me.....


Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 9:07:54 AM, you wrote:


https://openjdk.java.net/projects/jigsaw/quick-start

That should help, it includes the java command line syntax you're looking for.

Gj

On Sun, Oct 20, 2019 at 11:21 PM Geertjan Wielenga <ge...@apache.org> wrote:

To be honest, I'd love to help but I'm not going to spend any time guessing about your application, you're going to need to provide a way to access it, e.g., put it on GitHub, so that it can be downloaded, e.g., sorry, "import com.ptoye.astro.World", no idea what that is, and please do not try to explain -- just take your application and put it on GitHub or somewhere else (please not as a ZIP file) and then I'll be happy to help.

Indeed, yes, it would be very useful to everyone if you'd join the openjdk mailing lists and explain the problems you're having running java on the command line -- they need to know that otherwise they'll never hear from you and never make it work the way you'd like.

Gj



On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

OK, I've read up on modules and written my first Hello World program which compiles and runs fine using NetBeans. However, it doesn't run from a command line, even after I've removed the mistakes in the Ant-generated suggestion:

D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Error: Could not find or load main class com.ptoye.greetings.Main
Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main

The main class is:

package com.ptoye.greetings;
????import com.ptoye.astro.World;
??public class Main {??    
        public static void main(String[] args) {
??            System.out.format("Greetings %s!%n", World.name());
??        }
??}??

Where does one go from here? I'm using the Oracle version of Java, Would OpenJDK make any difference? AFAICS  it's the same.

Thanks for the mailing list link. I looked at them but they all seem to be oriented towards people developing OpenJDK rather than users. There isn't a "support" or "help" link on the OpenJDK site.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 14, 2019, 10:18:27 AM, you wrote:







On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I agree that the "java" command has nothing to do with Netbeans. I'll try to be more explicit:

I have a project which dates back to about 2006 and has a main class which I'll call A. This uses a separate class B which I developed separately. I included B as a library using A's project properties.

Using Netbeans 8 (and earlier) it was possible to run the project using a command line like
  java -jar A.jar
and the program ran. The Java version was 1.8. The path to the Java executable is in my PATH.

Earlier this year I wanted to develop it further, and decided to move to the latest version of NetBeans (11.1) and Java (12). Now the command line as given in the build output is
  C:\Program Files\Java\jdk-12.0.1/bin/java -cp directory\A.jar;directory\B.jar classpath.A

My main point is that I don't understand how or why this has changed. 


https://openjdk.java.net/projects/jigsaw/

There is now a module system in Java, meaning that there is now a module path and a class path. That was not there in JDK 8 and is now there since then.

Can you join the Java mailing lists and discuss further there: https://mail.openjdk.java.net/mailman/listinfo

Gj

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
File an issue with steps, and we can investigate and see where to fix that
output.

If it still gives problems, can you say what those problems are, or how can
we help?

Gj

On Mon, 21 Oct 2019 at 11:56, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> Thanks again. I'd found that page, and the code I produced was a copy of
> the code there. It seems that  a "-m" option is needed to indicate the main
> class.
> It still gives problems, but I'll try your suggestion of trying to join
> the openJDK mailing list.
>
> So the Ant script output now has three bugs:
>
>
>    1. No double quotes round the Java executable directory "Program Files"
>    2. "-module-path" should read "--module-path"
>    3. "-m" needed before the main class.
>
>
>
> Why the Java designer can't just stick to a single syntax is beyond me.....
>
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 21, 2019, 9:07:54 AM, you wrote:
>
>
> https://openjdk.java.net/projects/jigsaw/quick-start
>
> That should help, it includes the java command line syntax you're looking
> for.
>
> Gj
>
> On Sun, Oct 20, 2019 at 11:21 PM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
> To be honest, I'd love to help but I'm not going to spend any time
> guessing about your application, you're going to need to provide a way to
> access it, e.g., put it on GitHub, so that it can be downloaded, e.g.,
> sorry, "import com.ptoye.astro.World", no idea what that is, and please do
> not try to explain -- just take your application and put it on GitHub or
> somewhere else (please not as a ZIP file) and then I'll be happy to help.
>
> Indeed, yes, it would be very useful to everyone if you'd join the openjdk
> mailing lists and explain the problems you're having running java on the
> command line -- they need to know that otherwise they'll never hear from
> you and never make it work the way you'd like.
>
> Gj
>
>
>
> On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> OK, I've read up on modules and written my first Hello World program which
> compiles and runs fine using NetBeans. However, it doesn't run from a
> command line, even after I've removed the mistakes in the Ant-generated
> suggestion:
>
> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
> Error: Could not find or load main class com.ptoye.greetings.Main
> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>
> The main class is:
>
> package com.ptoye.greetings;
> ????import com.ptoye.astro.World;
> ??public class Main {??
>         public static void main(String[] args) {
> ??            System.out.format("Greetings %s!%n", World.name());
> ??        }
> ??}??
>
> Where does one go from here? I'm using the Oracle version of Java, Would
> OpenJDK make any difference? AFAICS  it's the same.
>
> Thanks for the mailing list link. I looked at them but they all seem to be
> oriented towards people developing OpenJDK rather than users. There isn't a
> "support" or "help" link on the OpenJDK site.
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>
>
>
>
>
>
>
> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> I agree that the "java" command has nothing to do with Netbeans. I'll try
> to be more explicit:
>
> I have a project which dates back to about 2006 and has a main class which
> I'll call A. This uses a separate class B which I developed separately. I
> included B as a library using A's project properties.
>
> Using Netbeans 8 (and earlier) it was possible to run the project using a
> command line like
>   java -jar A.jar
> and the program ran. The Java version was 1.8. The path to the Java
> executable is in my PATH.
>
> Earlier this year I wanted to develop it further, and decided to move to
> the latest version of NetBeans (11.1) and Java (12). Now the command line
> as given in the build output is
>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
> *directory\*B.jar *classpath.*A
>
> My main point is that I don't understand how or why this has changed.
>
> https://openjdk.java.net/projects/jigsaw/
>
> There is now a module system in Java, meaning that there is now a module
> path and a class path. That was not there in JDK 8 and is now there since
> then.
>
> Can you join the Java mailing lists and discuss further there:
> https://mail.openjdk.java.net/mailman/listinfo
>
> Gj
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Thanks again. I'd found that page, and the code I produced was a copy of the code there. It seems that  a "-m" option is needed to indicate the main class.
It still gives problems, but I'll try your suggestion of trying to join the openJDK mailing list.

So the Ant script output now has three bugs:

No double quotes round the Java executable directory "Program Files"
"-module-path" should read "--module-path"
"-m" needed before the main class.

Why the Java designer can't just stick to a single syntax is beyond me.....

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 21, 2019, 9:07:54 AM, you wrote:


https://openjdk.java.net/projects/jigsaw/quick-start

That should help, it includes the java command line syntax you're looking for.

Gj

On Sun, Oct 20, 2019 at 11:21 PM Geertjan Wielenga <ge...@apache.org> wrote:

To be honest, I'd love to help but I'm not going to spend any time guessing about your application, you're going to need to provide a way to access it, e.g., put it on GitHub, so that it can be downloaded, e.g., sorry, "import com.ptoye.astro.World", no idea what that is, and please do not try to explain -- just take your application and put it on GitHub or somewhere else (please not as a ZIP file) and then I'll be happy to help.

Indeed, yes, it would be very useful to everyone if you'd join the openjdk mailing lists and explain the problems you're having running java on the command line -- they need to know that otherwise they'll never hear from you and never make it work the way you'd like.

Gj



On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

OK, I've read up on modules and written my first Hello World program which compiles and runs fine using NetBeans. However, it doesn't run from a command line, even after I've removed the mistakes in the Ant-generated suggestion:

D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Error: Could not find or load main class com.ptoye.greetings.Main
Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main

The main class is:

package com.ptoye.greetings;
????import com.ptoye.astro.World;
??public class Main {??    
        public static void main(String[] args) {
??            System.out.format("Greetings %s!%n", World.name());
??        }
??}??

Where does one go from here? I'm using the Oracle version of Java, Would OpenJDK make any difference? AFAICS  it's the same.

Thanks for the mailing list link. I looked at them but they all seem to be oriented towards people developing OpenJDK rather than users. There isn't a "support" or "help" link on the OpenJDK site.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 14, 2019, 10:18:27 AM, you wrote:






On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I agree that the "java" command has nothing to do with Netbeans. I'll try to be more explicit:

I have a project which dates back to about 2006 and has a main class which I'll call A. This uses a separate class B which I developed separately. I included B as a library using A's project properties.

Using Netbeans 8 (and earlier) it was possible to run the project using a command line like
  java -jar A.jar
and the program ran. The Java version was 1.8. The path to the Java executable is in my PATH.

Earlier this year I wanted to develop it further, and decided to move to the latest version of NetBeans (11.1) and Java (12). Now the command line as given in the build output is
  C:\Program Files\Java\jdk-12.0.1/bin/java -cp directory\A.jar;directory\B.jar classpath.A

My main point is that I don't understand how or why this has changed. 


https://openjdk.java.net/projects/jigsaw/

There is now a module system in Java, meaning that there is now a module path and a class path. That was not there in JDK 8 and is now there since then.

Can you join the Java mailing lists and discuss further there: https://mail.openjdk.java.net/mailman/listinfo

Gj

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
https://openjdk.java.net/projects/jigsaw/quick-start

That should help, it includes the java command line syntax you're looking
for.

Gj

On Sun, Oct 20, 2019 at 11:21 PM Geertjan Wielenga <ge...@apache.org>
wrote:

> To be honest, I'd love to help but I'm not going to spend any time
> guessing about your application, you're going to need to provide a way to
> access it, e.g., put it on GitHub, so that it can be downloaded, e.g.,
> sorry, "import com.ptoye.astro.World", no idea what that is, and please do
> not try to explain -- just take your application and put it on GitHub or
> somewhere else (please not as a ZIP file) and then I'll be happy to help.
>
> Indeed, yes, it would be very useful to everyone if you'd join the openjdk
> mailing lists and explain the problems you're having running java on the
> command line -- they need to know that otherwise they'll never hear from
> you and never make it work the way you'd like.
>
> Gj
>
>
>
> On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:
>
>> Dear Geertjan,
>>
>> OK, I've read up on modules and written my first Hello World program
>> which compiles and runs fine using NetBeans. However, it doesn't run from a
>> command line, even after I've removed the mistakes in the Ant-generated
>> suggestion:
>>
>> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
>> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
>> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
>> Error: Could not find or load main class com.ptoye.greetings.Main
>> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>>
>> The main class is:
>>
>> package com.ptoye.greetings;
>> ????import com.ptoye.astro.World;
>> ??public class Main {??
>>         public static void main(String[] args) {
>> ??            System.out.format("Greetings %s!%n", World.name());
>> ??        }
>> ??}??
>>
>> Where does one go from here? I'm using the Oracle version of Java, Would
>> OpenJDK make any difference? AFAICS  it's the same.
>>
>> Thanks for the mailing list link. I looked at them but they all seem to
>> be oriented towards people developing OpenJDK rather than users. There
>> isn't a "support" or "help" link on the OpenJDK site.
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>> -------------------------
>> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>>
>>
>>
>>
>>
>>
>> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>>
>> Dear Geertjan,
>>
>> I agree that the "java" command has nothing to do with Netbeans. I'll try
>> to be more explicit:
>>
>> I have a project which dates back to about 2006 and has a main class
>> which I'll call A. This uses a separate class B which I developed
>> separately. I included B as a library using A's project properties.
>>
>> Using Netbeans 8 (and earlier) it was possible to run the project using a
>> command line like
>>   java -jar A.jar
>> and the program ran. The Java version was 1.8. The path to the Java
>> executable is in my PATH.
>>
>> Earlier this year I wanted to develop it further, and decided to move to
>> the latest version of NetBeans (11.1) and Java (12). Now the command line
>> as given in the build output is
>>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
>> *directory\*B.jar *classpath.*A
>>
>> My main point is that I don't understand how or why this has changed.
>>
>> https://openjdk.java.net/projects/jigsaw/
>>
>> There is now a module system in Java, meaning that there is now a module
>> path and a class path. That was not there in JDK 8 and is now there since
>> then.
>>
>> Can you join the Java mailing lists and discuss further there:
>> https://mail.openjdk.java.net/mailman/listinfo
>>
>> Gj
>>
>

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
To be honest, I'd love to help but I'm not going to spend any time guessing
about your application, you're going to need to provide a way to access it,
e.g., put it on GitHub, so that it can be downloaded, e.g., sorry, "import
com.ptoye.astro.World", no idea what that is, and please do not try to
explain -- just take your application and put it on GitHub or somewhere
else (please not as a ZIP file) and then I'll be happy to help.

Indeed, yes, it would be very useful to everyone if you'd join the openjdk
mailing lists and explain the problems you're having running java on the
command line -- they need to know that otherwise they'll never hear from
you and never make it work the way you'd like.

Gj



On Sun, Oct 20, 2019 at 8:10 PM Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> OK, I've read up on modules and written my first Hello World program which
> compiles and runs fine using NetBeans. However, it doesn't run from a
> command line, even after I've removed the mistakes in the Ant-generated
> suggestion:
>
> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
> Error: Could not find or load main class com.ptoye.greetings.Main
> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>
> The main class is:
>
> package com.ptoye.greetings;
> ????import com.ptoye.astro.World;
> ??public class Main {??
>         public static void main(String[] args) {
> ??            System.out.format("Greetings %s!%n", World.name());
> ??        }
> ??}??
>
> Where does one go from here? I'm using the Oracle version of Java, Would
> OpenJDK make any difference? AFAICS  it's the same.
>
> Thanks for the mailing list link. I looked at them but they all seem to be
> oriented towards people developing OpenJDK rather than users. There isn't a
> "support" or "help" link on the OpenJDK site.
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>
>
>
>
>
>
> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> I agree that the "java" command has nothing to do with Netbeans. I'll try
> to be more explicit:
>
> I have a project which dates back to about 2006 and has a main class which
> I'll call A. This uses a separate class B which I developed separately. I
> included B as a library using A's project properties.
>
> Using Netbeans 8 (and earlier) it was possible to run the project using a
> command line like
>   java -jar A.jar
> and the program ran. The Java version was 1.8. The path to the Java
> executable is in my PATH.
>
> Earlier this year I wanted to develop it further, and decided to move to
> the latest version of NetBeans (11.1) and Java (12). Now the command line
> as given in the build output is
>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
> *directory\*B.jar *classpath.*A
>
> My main point is that I don't understand how or why this has changed.
>
> https://openjdk.java.net/projects/jigsaw/
>
> There is now a module system in Java, meaning that there is now a module
> path and a class path. That was not there in JDK 8 and is now there since
> then.
>
> Can you join the Java mailing lists and discuss further there:
> https://mail.openjdk.java.net/mailman/listinfo
>
> Gj
>

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
OK, JDK 12. Can someone reproduce or help?

Gj

On Sun, 20 Oct 2019 at 20:18, Geertjan Wielenga <ge...@apache.org> wrote:

> What is the version of Java you’re using on the command line?
>
> Gj
>
> On Sun, 20 Oct 2019 at 20:10, Peter Toye <ne...@ptoye.com> wrote:
>
>> Dear Geertjan,
>>
>> OK, I've read up on modules and written my first Hello World program
>> which compiles and runs fine using NetBeans. However, it doesn't run from a
>> command line, even after I've removed the mistakes in the Ant-generated
>> suggestion:
>>
>> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
>> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
>> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
>> Error: Could not find or load main class com.ptoye.greetings.Main
>> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>>
>> The main class is:
>>
>> package com.ptoye.greetings;
>> ????import com.ptoye.astro.World;
>> ??public class Main {??
>>         public static void main(String[] args) {
>> ??            System.out.format("Greetings %s!%n", World.name());
>> ??        }
>> ??}??
>>
>> Where does one go from here? I'm using the Oracle version of Java, Would
>> OpenJDK make any difference? AFAICS  it's the same.
>>
>> Thanks for the mailing list link. I looked at them but they all seem to
>> be oriented towards people developing OpenJDK rather than users. There
>> isn't a "support" or "help" link on the OpenJDK site.
>>
>> Best regards,
>>
>> Peter
>> mailto:netbeans@ptoye.com
>> www.ptoye.com
>>
>> -------------------------
>> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>>
>>
>>
>>
>>
>>
>> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>>
>> Dear Geertjan,
>>
>> I agree that the "java" command has nothing to do with Netbeans. I'll try
>> to be more explicit:
>>
>> I have a project which dates back to about 2006 and has a main class
>> which I'll call A. This uses a separate class B which I developed
>> separately. I included B as a library using A's project properties.
>>
>> Using Netbeans 8 (and earlier) it was possible to run the project using a
>> command line like
>>   java -jar A.jar
>> and the program ran. The Java version was 1.8. The path to the Java
>> executable is in my PATH.
>>
>> Earlier this year I wanted to develop it further, and decided to move to
>> the latest version of NetBeans (11.1) and Java (12). Now the command line
>> as given in the build output is
>>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
>> *directory\*B.jar *classpath.*A
>>
>> My main point is that I don't understand how or why this has changed.
>>
>> https://openjdk.java.net/projects/jigsaw/
>>
>> There is now a module system in Java, meaning that there is now a module
>> path and a class path. That was not there in JDK 8 and is now there since
>> then.
>>
>> Can you join the Java mailing lists and discuss further there:
>> https://mail.openjdk.java.net/mailman/listinfo
>>
>> Gj
>>
>

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
What is the version of Java you’re using on the command line?

Gj

On Sun, 20 Oct 2019 at 20:10, Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> OK, I've read up on modules and written my first Hello World program which
> compiles and runs fine using NetBeans. However, it doesn't run from a
> command line, even after I've removed the mistakes in the Ant-generated
> suggestion:
>
> D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path
> D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
> Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
> Error: Could not find or load main class com.ptoye.greetings.Main
> Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main
>
> The main class is:
>
> package com.ptoye.greetings;
> ????import com.ptoye.astro.World;
> ??public class Main {??
>         public static void main(String[] args) {
> ??            System.out.format("Greetings %s!%n", World.name());
> ??        }
> ??}??
>
> Where does one go from here? I'm using the Oracle version of Java, Would
> OpenJDK make any difference? AFAICS  it's the same.
>
> Thanks for the mailing list link. I looked at them but they all seem to be
> oriented towards people developing OpenJDK rather than users. There isn't a
> "support" or "help" link on the OpenJDK site.
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Monday, October 14, 2019, 10:18:27 AM, you wrote:
>
>
>
>
>
>
> On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:
>
> Dear Geertjan,
>
> I agree that the "java" command has nothing to do with Netbeans. I'll try
> to be more explicit:
>
> I have a project which dates back to about 2006 and has a main class which
> I'll call A. This uses a separate class B which I developed separately. I
> included B as a library using A's project properties.
>
> Using Netbeans 8 (and earlier) it was possible to run the project using a
> command line like
>   java -jar A.jar
> and the program ran. The Java version was 1.8. The path to the Java
> executable is in my PATH.
>
> Earlier this year I wanted to develop it further, and decided to move to
> the latest version of NetBeans (11.1) and Java (12). Now the command line
> as given in the build output is
>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
> *directory\*B.jar *classpath.*A
>
> My main point is that I don't understand how or why this has changed.
>
> https://openjdk.java.net/projects/jigsaw/
>
> There is now a module system in Java, meaning that there is now a module
> path and a class path. That was not there in JDK 8 and is now there since
> then.
>
> Can you join the Java mailing lists and discuss further there:
> https://mail.openjdk.java.net/mailman/listinfo
>
> Gj
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

OK, I've read up on modules and written my first Hello World program which compiles and runs fine using NetBeans. However, it doesn't run from a command line, even after I've removed the mistakes in the Ant-generated suggestion:

D:\>"C:\Program Files\Java\jdk-12.0.1/bin/java" --module-path D:\Peter\Netbeans\TestModules1\build\modules com.ptoye.greetings.Main
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Error: Could not find or load main class com.ptoye.greetings.Main
Caused by: java.lang.ClassNotFoundException: com.ptoye.greetings.Main

The main class is:

package com.ptoye.greetings;
????import com.ptoye.astro.World;
??public class Main {??    
        public static void main(String[] args) {
??            System.out.format("Greetings %s!%n", World.name());
??        }
??}??

Where does one go from here? I'm using the Oracle version of Java, Would OpenJDK make any difference? AFAICS  it's the same.

Thanks for the mailing list link. I looked at them but they all seem to be oriented towards people developing OpenJDK rather than users. There isn't a "support" or "help" link on the OpenJDK site.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 14, 2019, 10:18:27 AM, you wrote:





On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I agree that the "java" command has nothing to do with Netbeans. I'll try to be more explicit:

I have a project which dates back to about 2006 and has a main class which I'll call A. This uses a separate class B which I developed separately. I included B as a library using A's project properties.

Using Netbeans 8 (and earlier) it was possible to run the project using a command line like
  java -jar A.jar
and the program ran. The Java version was 1.8. The path to the Java executable is in my PATH.

Earlier this year I wanted to develop it further, and decided to move to the latest version of NetBeans (11.1) and Java (12). Now the command line as given in the build output is
  C:\Program Files\Java\jdk-12.0.1/bin/java -cp directory\A.jar;directory\B.jar classpath.A

My main point is that I don't understand how or why this has changed. 


https://openjdk.java.net/projects/jigsaw/

There is now a module system in Java, meaning that there is now a module path and a class path. That was not there in JDK 8 and is now there since then.

Can you join the Java mailing lists and discuss further there: https://mail.openjdk.java.net/mailman/listinfo

Gj

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

Thanks - I’ll try that. I don't think OpenJDK existed when I last looked at Java. Astonishing how you can get out-of-date so fast.

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Monday, October 14, 2019, 10:18:27 AM, you wrote:




On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:

Dear Geertjan,

I agree that the "java" command has nothing to do with Netbeans. I'll try to be more explicit:

I have a project which dates back to about 2006 and has a main class which I'll call A. This uses a separate class B which I developed separately. I included B as a library using A's project properties.

Using Netbeans 8 (and earlier) it was possible to run the project using a command line like
  java -jar A.jar
and the program ran. The Java version was 1.8. The path to the Java executable is in my PATH.

Earlier this year I wanted to develop it further, and decided to move to the latest version of NetBeans (11.1) and Java (12). Now the command line as given in the build output is
  C:\Program Files\Java\jdk-12.0.1/bin/java -cp directory\A.jar;directory\B.jar classpath.A

My main point is that I don't understand how or why this has changed. 


https://openjdk.java.net/projects/jigsaw/

There is now a module system in Java, meaning that there is now a module path and a class path. That was not there in JDK 8 and is now there since then.

Can you join the Java mailing lists and discuss further there: https://mail.openjdk.java.net/mailman/listinfo

Gj

 

I agree that Oracle no longer have a JAVA_HOME environment variable to point to the java run-time executable and they don't put it in the PATH, which is a pain, but I can do that myself.

But as far as I can see, the "Libraries" sections of "project properties" are identical for the NB8 and NB11 projects, with a few directory changes. So why is the command line different? Is this a Java issue or has someting changed in the way that NB builds its jar files?

And also, the NB11.1 command line as given by Ant is incorrect - the Java program path needs quotes because of the space in the path. A minor bug, but annoying when you use cut-and-paste to put it into a batch file!


Does this clear things up?

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Sunday, October 13, 2019, 7:47:57 PM, you wrote:




You appear to be talking about the “java” command line below, which has nothing at all to do with NetBeans. You seen to be using different versions of Java.

Gj


On Fri, 20 Sep 2019 at 16:44, Peter Toye <ne...@ptoye.com> wrote:

Having just moved from NB version 8 to 11.1 there seems to have been a change in the command line needed to run a project.

The OS is Windows 7 Home.

The project has two external libraries: one in the Java modules in the NetBeans 11 directory, and one of my own. In version 8 it was possible to run the program with a command line like
 
   java -jar program.jar
   
but this no longer works, and I have to put in a command line like

  java -cp library paths program.jar
 
which is a pain, as I can't automate that into a batch file.

Is there any way of getting the libraries (or references to them) included in the jar file? The properties|Libraries|Run tab shows that the classpaths for Compiling Sources and Compiled Sources are included (at least as I understand the symbols on that page). Does the "Build Dependencies" tickbox have any significance here? The lack of a help file means that I can't find out what most of the window items actually mean.

As a rider to this question, there seems to be two small bugs in the Ant script which produces the command line for running the project :

To run this application from the command line without Ant, try:
??C:\Program Files\Java\jdk-12.0.1/bin/java -cp C:\Program Files\NetBeans 11\netbeans\java\modules\ext\AbsoluteLayout.jar;D:\Peter\Netbeans\Partitions511\dist\Partitions511.jar;D:\Peter\Netbeans\KillerSudoku11\dist\KillerSudoku11.jar com.ptoye.TestKiller.TestKiller??

1) In Windows, the Java executable and Netbeans are in the "Program Files" or "Program Files (x86)" folder. This should have quotes round it to run successfully.

2) In NB 11.1, the output mentions "Netbeans 11" - Shouldn't this be C:\Program Files\NetBeans-11.1?
 
Regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
On Mon, Oct 14, 2019 at 11:16 AM Peter Toye <ne...@ptoye.com> wrote:

> Dear Geertjan,
>
> I agree that the "java" command has nothing to do with Netbeans. I'll try
> to be more explicit:
>
> I have a project which dates back to about 2006 and has a main class which
> I'll call A. This uses a separate class B which I developed separately. I
> included B as a library using A's project properties.
>
> Using Netbeans 8 (and earlier) it was possible to run the project using a
> command line like
>   java -jar A.jar
> and the program ran. The Java version was 1.8. The path to the Java
> executable is in my PATH.
>
> Earlier this year I wanted to develop it further, and decided to move to
> the latest version of NetBeans (11.1) and Java (12). Now the command line
> as given in the build output is
>   C:\Program Files\Java\jdk-12.0.1/bin/java -cp *directory\*A.jar;
> *directory\*B.jar *classpath.*A
>
> My main point is that I don't understand how or why this has changed.
>


https://openjdk.java.net/projects/jigsaw/

There is now a module system in Java, meaning that there is now a module
path and a class path. That was not there in JDK 8 and is now there since
then.

Can you join the Java mailing lists and discuss further there:
https://mail.openjdk.java.net/mailman/listinfo

Gj



> I agree that Oracle no longer have a JAVA_HOME environment variable to
> point to the java run-time executable and they don't put it in the PATH,
> which is a pain, but I can do that myself.
>
> But as far as I can see, the "Libraries" sections of "project properties"
> are identical for the NB8 and NB11 projects, with a few directory changes.
> So why is the command line different? Is this a Java issue or has someting
> changed in the way that NB builds its jar files?
>
> And also, the NB11.1 command line as given by Ant is incorrect - the Java
> program path needs quotes because of the space in the path. A minor bug,
> but annoying when you use cut-and-paste to put it into a batch file!
>
>
> Does this clear things up?
>
> Best regards,
>
> Peter
> mailto:netbeans@ptoye.com
> www.ptoye.com
>
> -------------------------
> Sunday, October 13, 2019, 7:47:57 PM, you wrote:
>
>
>
>
> You appear to be talking about the “java” command line below, which has
> nothing at all to do with NetBeans. You seen to be using different versions
> of Java.
>
> Gj
>
>
> On Fri, 20 Sep 2019 at 16:44, Peter Toye <ne...@ptoye.com> wrote:
>
> Having just moved from NB version 8 to 11.1 there seems to have been a
> change in the command line needed to run a project.
>
> The OS is Windows 7 Home.
>
> The project has two external libraries: one in the Java modules in the
> NetBeans 11 directory, and one of my own. In version 8 it was possible to
> run the program with a command line like
>
>    java -jar program.jar
>
> but this no longer works, and I have to put in a command line like
>
>   java -cp library paths program.jar
>
> which is a pain, as I can't automate that into a batch file.
>
> Is there any way of getting the libraries (or references to them) included
> in the jar file? The properties|Libraries|Run tab shows that the classpaths
> for Compiling Sources and Compiled Sources are included (at least as I
> understand the symbols on that page). Does the "Build Dependencies" tickbox
> have any significance here? The lack of a help file means that I can't find
> out what most of the window items actually mean.
>
> As a rider to this question, there seems to be two small bugs in the Ant
> script which produces the command line for running the project :
>
> To run this application from the command line without Ant, try:
> ??C:\Program Files\Java\jdk-12.0.1/bin/java -cp C:\Program Files\NetBeans
> 11\netbeans\java\modules\ext\AbsoluteLayout.jar;D:\Peter\Netbeans\Partitions511\dist\Partitions511.jar;D:\Peter\Netbeans\KillerSudoku11\dist\KillerSudoku11.jar
> com.ptoye.TestKiller.TestKiller??
>
> 1) In Windows, the Java executable and Netbeans are in the "Program Files"
> or "Program Files (x86)" folder. This should have quotes round it to run
> successfully.
>
> 2) In NB 11.1, the output mentions "Netbeans 11" - Shouldn't this be
> C:\Program Files\NetBeans-11.1?
>
> Regards,
>
> Peter
> mailto:netbeans@ptoye.com <ne...@ptoye.com>
> www.ptoye.com
>

Re: Java project now needs classpaths to run it

Posted by Peter Toye <ne...@ptoye.com>.
Dear Geertjan,

I agree that the "java" command has nothing to do with Netbeans. I'll try to be more explicit:

I have a project which dates back to about 2006 and has a main class which I'll call A. This uses a separate class B which I developed separately. I included B as a library using A's project properties. 

Using Netbeans 8 (and earlier) it was possible to run the project using a command line like
  java -jar A.jar
and the program ran. The Java version was 1.8. The path to the Java executable is in my PATH.

Earlier this year I wanted to develop it further, and decided to move to the latest version of NetBeans (11.1) and Java (12). Now the command line as given in the build output is
  C:\Program Files\Java\jdk-12.0.1/bin/java -cp directory\A.jar;directory\B.jar classpath.A

My main point is that I don't understand how or why this has changed. I agree that Oracle no longer have a JAVA_HOME environment variable to point to the java run-time executable and they don't put it in the PATH, which is a pain, but I can do that myself.

But as far as I can see, the "Libraries" sections of "project properties" are identical for the NB8 and NB11 projects, with a few directory changes. So why is the command line different? Is this a Java issue or has someting changed in the way that NB builds its jar files?

And also, the NB11.1 command line as given by Ant is incorrect - the Java program path needs quotes because of the space in the path. A minor bug, but annoying when you use cut-and-paste to put it into a batch file!


Does this clear things up?

Best regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

-------------------------
Sunday, October 13, 2019, 7:47:57 PM, you wrote:



You appear to be talking about the “java” command line below, which has nothing at all to do with NetBeans. You seen to be using different versions of Java.

Gj


On Fri, 20 Sep 2019 at 16:44, Peter Toye <ne...@ptoye.com> wrote:

Having just moved from NB version 8 to 11.1 there seems to have been a change in the command line needed to run a project.

The OS is Windows 7 Home.

The project has two external libraries: one in the Java modules in the NetBeans 11 directory, and one of my own. In version 8 it was possible to run the program with a command line like
 
   java -jar program.jar
   
but this no longer works, and I have to put in a command line like

  java -cp library paths program.jar
 
which is a pain, as I can't automate that into a batch file.

Is there any way of getting the libraries (or references to them) included in the jar file? The properties|Libraries|Run tab shows that the classpaths for Compiling Sources and Compiled Sources are included (at least as I understand the symbols on that page). Does the "Build Dependencies" tickbox have any significance here? The lack of a help file means that I can't find out what most of the window items actually mean.

As a rider to this question, there seems to be two small bugs in the Ant script which produces the command line for running the project :

To run this application from the command line without Ant, try:
??C:\Program Files\Java\jdk-12.0.1/bin/java -cp C:\Program Files\NetBeans 11\netbeans\java\modules\ext\AbsoluteLayout.jar;D:\Peter\Netbeans\Partitions511\dist\Partitions511.jar;D:\Peter\Netbeans\KillerSudoku11\dist\KillerSudoku11.jar com.ptoye.TestKiller.TestKiller??

1) In Windows, the Java executable and Netbeans are in the "Program Files" or "Program Files (x86)" folder. This should have quotes round it to run successfully.

2) In NB 11.1, the output mentions "Netbeans 11" - Shouldn't this be C:\Program Files\NetBeans-11.1?
 
Regards,

Peter
mailto:netbeans@ptoye.com
www.ptoye.com

Re: Java project now needs classpaths to run it

Posted by Geertjan Wielenga <ge...@apache.org>.
You appear to be talking about the “java” command line below, which has
nothing at all to do with NetBeans. You seen to be using different versions
of Java.

Gj


On Fri, 20 Sep 2019 at 16:44, Peter Toye <ne...@ptoye.com> wrote:

> Having just moved from NB version 8 to 11.1 there seems to have been a
> change in the command line needed to run a project.
>
> The OS is Windows 7 Home.
>
> The project has two external libraries: one in the Java modules in the
> NetBeans 11 directory, and one of my own. In version 8 it was possible to
> run the program with a command line like
>
>    java -jar program.jar
>
> but this no longer works, and I have to put in a command line like
>
>   java -cp library paths program.jar
>
> which is a pain, as I can't automate that into a batch file.
>
> Is there any way of getting the libraries (or references to them) included
> in the jar file? The properties|Libraries|Run tab shows that the classpaths
> for Compiling Sources and Compiled Sources are included (at least as I
> understand the symbols on that page). Does the "Build Dependencies" tickbox
> have any significance here? The lack of a help file means that I can't find
> out what most of the window items actually mean.
>
> As a rider to this question, there seems to be two small bugs in the Ant
> script which produces the command line for running the project :
>
> To run this application from the command line without Ant, try:
> ??C:\Program Files\Java\jdk-12.0.1/bin/java -cp C:\Program Files\NetBeans
> 11\netbeans\java\modules\ext\AbsoluteLayout.jar;D:\Peter\Netbeans\Partitions511\dist\Partitions511.jar;D:\Peter\Netbeans\KillerSudoku11\dist\KillerSudoku11.jar
> com.ptoye.TestKiller.TestKiller??
>
> 1) In Windows, the Java executable and Netbeans are in the "Program Files"
> or "Program Files (x86)" folder. This should have quotes round it to run
> successfully.
>
> 2) In NB 11.1, the output mentions "Netbeans 11" - Shouldn't this be C:\Program
> Files\NetBeans-11.1?
>
> Regards,
>
> Peter
> mailto:netbeans@ptoye.com <ne...@ptoye.com>
> www.ptoye.com
>