Topics

Netbeans Help

steve young
 

Hi Folks,

I tried IDE's in the 90's and had bad experiences so have previously stuck with Notepad++ .
Since Randall's excellent suggestion that I try out an IDE, I've had my main dev laptop fail, so installed NB on a fresh Win7 install with 64bit JDK 8u221
I'm actually pretty impressed with the inline hint suggestions that NetBeans 11.1 offers however am struggling to compile.

Git not installed nor ant, using the JMRI folder in the Github desktop location ( For the moment I'll stick with Github Desktop for version control ).
I've been following the advice from
https://www.jmri.org/help/en/html/doc/Technical/NetBeans.shtml
however should I have Git installed?

TIA,
Steve.

Output from NB console

ant -f C:\\Users\\steve\\Documents\\GitHub\\JMRI\\nbproject\\nbjdk.xml clean debugWarning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_221clean:Execute failed: java.io.IOException: Cannot run program "git" (in directory "C:\Users\steve\Documents\GitHub\JMRI"): CreateProcess error=2, The system cannot find the file specifiedJMRI.clean:C:\Users\steve\Documents\GitHub\JMRI\nbproject\nbjdk.xml:11: The following error occurred while executing this line:C:\Users\steve\Documents\GitHub\JMRI\build.xml:439: java.nio.file.InvalidPathException: Trailing char < > at index 41:  C:\Users\steve\Documents\GitHub\JMRI\temp at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191)at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)at java.io.File.toPath(File.java:2234)at org.apache.tools.ant.taskdefs.Delete.isDanglingSymlink(Delete.java:879)at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:642)at org.netbeans.modules.java.source.ant.DeleteTask.access$001(DeleteTask.java:37)at org.netbeans.modules.java.source.ant.DeleteTask$1.call(DeleteTask.java:52)at org.netbeans.modules.java.source.ant.DeleteTask$1.call(DeleteTask.java:49)at org.netbeans.modules.java.source.ant.DeleteTask.execute(DeleteTask.java:60)at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)at org.apache.tools.ant.Task.perform(Task.java:350)at org.apache.tools.ant.Target.execute(Target.java:449)at org.apache.tools.ant.Target.performTasks(Target.java:470)at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)at org.apache.tools.ant.Project.executeTargets(Project.java:1251)at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)at org.apache.tools.ant.Task.perform(Task.java:350)at org.apache.tools.ant.Target.execute(Target.java:449)at org.apache.tools.ant.Target.performTasks(Target.java:470)at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)at org.apache.tools.ant.Project.executeTarget(Project.java:1361)at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)at org.apache.tools.ant.Project.executeTargets(Project.java:1251)at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)BUILD FAILED (total time: 1 second)

Randall Wood
 

I’d install git. Ant includes the first few characters of the current commit hash in the JMRI version number.

Randall

On Oct 13, 2019, at 08:20, steve young via Groups.Io <icklesteve@...> wrote:

Hi Folks,

I tried IDE's in the 90's and had bad experiences so have previously stuck with Notepad++ .
Since Randall's excellent suggestion that I try out an IDE, I've had my main dev laptop fail, so installed NB on a fresh Win7 install with 64bit JDK 8u221
I'm actually pretty impressed with the inline hint suggestions that NetBeans 11.1 offers however am struggling to compile.

Git not installed nor ant, using the JMRI folder in the Github desktop location ( For the moment I'll stick with Github Desktop for version control ).
I've been following the advice from
https://www.jmri.org/help/en/html/doc/Technical/NetBeans.shtml
however should I have Git installed?

TIA,
Steve.

Output from NB console

ant -f C:\\Users\\steve\\Documents\\GitHub\\JMRI\\nbproject\\nbjdk.xml clean debugWarning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_221clean:Execute failed: java.io.IOException: Cannot run program "git" (in directory "C:\Users\steve\Documents\GitHub\JMRI"): CreateProcess error=2, The system cannot find the file specifiedJMRI.clean:C:\Users\steve\Documents\GitHub\JMRI\nbproject\nbjdk.xml:11: The following error occurred while executing this line:C:\Users\steve\Documents\GitHub\JMRI\build.xml:439: java.nio.file.InvalidPathException: Trailing char < > at index 41:  C:\Users\steve\Documents\GitHub\JMRI\temp at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191)at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)at java.io.File.toPath(File.java:2234)at org.apache.tools.ant.taskdefs.Delete.isDanglingSymlink(Delete.java:879)at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:642)at org.netbeans.modules.java.source.ant.DeleteTask.access$001(DeleteTask.java:37)at org.netbeans.modules.java.source.ant.DeleteTask$1.call(DeleteTask.java:52)at org.netbeans.modules.java.source.ant.DeleteTask$1.call(DeleteTask.java:49)at org.netbeans.modules.java.source.ant.DeleteTask.execute(DeleteTask.java:60)at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)at org.apache.tools.ant.Task.perform(Task.java:350)at org.apache.tools.ant.Target.execute(Target.java:449)at org.apache.tools.ant.Target.performTasks(Target.java:470)at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)at org.apache.tools.ant.Project.executeTargets(Project.java:1251)at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)at org.apache.tools.ant.Task.perform(Task.java:350)at org.apache.tools.ant.Target.execute(Target.java:449)at org.apache.tools.ant.Target.performTasks(Target.java:470)at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)at org.apache.tools.ant.Project.executeTarget(Project.java:1361)at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)at org.apache.tools.ant.Project.executeTargets(Project.java:1251)at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)BUILD FAILED (total time: 1 second)

Svata Dedic
 

Dne 13. 10. 19 v 14:20 steve young via Groups.Io napsal(a):
I've been following the advice from
https://www.jmri.org/help/en/html/doc/Technical/NetBeans.shtml
however should I have Git installed?
Shouldn't be necessary; NetBeans ships with Eclipse JGit implementation bundled AFAIK, so it shouldn't require external git tools.

-S.

Randall Wood
 

The JMRI build chain in ant does not use NetBean’s built in Git tools, even when executed from within NetBeans, so, yes, installing git is required.

On Oct 13, 2019, at 8:26 AM, Svata Dedic <svatopluk.dedic@...> wrote:


Dne 13. 10. 19 v 14:20 steve young via Groups.Io napsal(a):
I've been following the advice from
https://www.jmri.org/help/en/html/doc/Technical/NetBeans.shtml
however should I have Git installed?
Shouldn't be necessary; NetBeans ships with Eclipse JGit implementation bundled AFAIK, so it shouldn't require external git tools.

-S.



Bob M.
 

Steve,

In my experience, Netbeans' GIT support is full-featured, but DOES NOT work well in a "triangular" repository situation as is recommended in JMRI's GIT help.

What I saw was that Netbeans would _CHANGE_ the local repository's "remote" setting for "push" to match the setting for the "remote" "pull". This effectively bypassed the personal github repository.

Based on that experience, I have NOT done any "pull" or "push" operations from Netbeans - only from a separately-installed GIT command-line tool.

If I recall correctly, Github Desktop install has an option to include a linux-based terminal with git command line support. I do not remember the details. On my Win7Pro machine, I am currently using a GIT command line which was separate from the Github Desktop implementation. Unfortunately, I do not know where I got it...

FYI - it appears that Netbeans support for ANT is running in your Netbeans install, otherwise you would not have gotten the failure to find 'git' error you've shown.

I have not knowingly installed an ANT implementation.

I perform any JMRI build operations via right-clicking on the "build.xml" file and choosing the correct option, or via a pushbutton if simply running PanelPro or running a test of a single module.

This has served me well for many years, over I think Netbeans 6.x thru Netbeans 8.x.

When I press the "run" button, I get the following in the Netbeans "output" window. Note that there is a "cannot find git" message, but it does not stop the ant build!

ant -f "E:\\User Data\\NetBeans\\JMRI\\nbproject\\nbjdk.xml" panelpro
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_25
panelpro:
Execute failed: java.io.IOException: Cannot run program "git" (in directory "E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find the file specified
JMRI.init:
JMRI.copyfiles:
JMRI.jjtree:
JMRI.javacc:
JMRI.update-template-code:
Copying 1 file to E:\User Data\NetBeans\JMRI\java\tmp
JMRI.compile-generated-source:
Copying 1 file to E:\User Data\NetBeans\JMRI\target\classes\jmri
JMRI.compile:
JMRI.debug:
JMRI.panelpro:
Execute failed: java.io.IOException: Cannot run program "git" (in directory "E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find the file specified
JMRI.runtime-library-selection:
arch.lib.path E:\User Data\NetBeans\JMRI/lib/windows/x64:E:\User Data\NetBeans\JMRI/lib/windows
Launch normally (no debugger support)
2019-10-13 08:35:59,707 util.Log4JUtil INFO - ****** JMRI log ******* [main]
2019-10-13 08:35:59,723 util.Log4JUtil INFO - This log is appended to file: C:\Users\huzzah\JMRI\log\messages.log [main]
2019-10-13 08:35:59,723 util.Log4JUtil INFO - This log is stored in file: C:\Users\huzzah\JMRI\log\session.log [main]
2019-10-13 08:35:59,739 apps.Apps INFO - PanelPro version 4.17.5ish+huzzah+20191013T1235Z starts under Java 1.8.0_25 on Windows 7 amd64 v6.1 at Sun Oct 13 08:35:59 EDT 2019 [main]
2019-10-13 08:36:01,720 apps.Apps INFO - Starting with profile AGE3_sim.3f113c63 [main]
2019-10-13 08:36:02,110 node.NodeIdentity INFO - Using 54a13122-2e81-44c1-a2ae-3ecc16430ef7 as the JMRI storage identity for profile id 3f113c63 [AWT-EventQueue-0]
2019-10-13 08:36:02,437 xml.AbstractSerialConnectionConfigXml INFO - Starting to connect for "C/MRI" [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path program: is E:\User Data\NetBeans\JMRI\ [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path preference: is C:\Users\huzzah\JMRI\AGE3_sim.jmri\ [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path profile: is C:\Users\huzzah\JMRI\AGE3_sim.jmri\ [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path settings: is C:\Users\huzzah\JMRI\ [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path home: is C:\Users\huzzah\ [main]
2019-10-13 08:36:03,093 util.FileUtilSupport INFO - File path scripts: is C:\Users\huzzah\JMRI\AGE3_sim.jmri\jython\ [main]
2019-10-13 08:36:04,840 PanelPro.PanelPro INFO - Main initialization done [main]


I believe that the git version I am running is _not_ integrated into the operating system. This is likely the cause of the error. Luckily Netbeans (or JMRI's ant build mechanism?) has some way to get past the error.

Regards,
Billybob

Bob Jacobsen
 

People don’t have to use any particular Git setup for JMRI. We recommend that one for beginners because some people think it’s easier for beginners, but there are certainly other approaches.

Another one is to use separate remote settings explicitly. I’ve seen a couple examples:

- have origin point at GitHub JMRI/JMRI so “git full origin” does an update; have a separate remote called ‘mine’ pointing to your own GitHub repot and use ‘git push mine’ when something is ready for PR (Not and IDE recommendation for people who have authority to push to JMRI/JMRI, because it’s easy to make a mistake)

- or flip that, with a remote called ‘origin’ pointing to your own, and a remote called ‘main’ pointing to JMRI/JMRI. (This one tends to cause people to be working well behind head, because they forget to do timely “git pull main” operations)

Lots of ways to do this….

Bob

On Oct 13, 2019, at 5:41 AM, Bob M. <jawhugrps@...> wrote:

In my experience, Netbeans' GIT support is full-featured, but DOES NOT work well in a "triangular" repository situation as is recommended in JMRI's GIT help.

What I saw was that Netbeans would _CHANGE_ the local repository's "remote" setting for "push" to match the setting for the "remote" "pull". This effectively bypassed the personal github repository.
--
Bob Jacobsen
@BobJacobsen

steve young
 

Thanks for all of the suggestions folks.

Installing GIT made little difference.
Although I was unable to do ant ant clean ( I'll start another topic re that ), I discovered during a build that the machine simply did not have enough oomph . . .

Have just managed to do a temp fix on dev. laptop and have installed NB :-)

Steve