Notes for Windows Users

263 views
Skip to first unread message

Jacob Christ

unread,
Nov 15, 2015, 1:36:25 PM11/15/15
to ope...@googlegroups.com
Jason,

I built openpnp for the first time from source on Windows this morning.  I have a few notes that I wanted to add to the build instructions for Windows users.  I didn't want to add them without running them by you/the group first.

o. maven requires the environmental variable JAVA_HOME to be set.  This should point to the jdk directory (and not the jdk\bin directory).  On my system JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_66

o. Windows has a maximum number of characters allowed in the PATH environment variable, for this reason I try to avoid adding things to the path that don't get used on a daily basis.  For this reason I created a batch file (I called it buildpnp.bat) that adds maven bin to my path for building that looks something like this:

SET PATH=E:\openpnp\apache-maven-3.3.3\bin;%PATH%

so when I want to build I just run this batch file first.

o. The first time I built with maven using the "mvn package" command there was a build error.  It said to build using the -X option so I tried "mvn -X package".  For some reason this build successfully.  So I just tried "mvn package" again and it too built successfully.

--- pre built binaries ---

Before I tired to build I just down loaded the pre-built package for Windows.  This is an installer.  I didn't actually install, but the instructions in the manual don't match, that is they say to unzip and run the openpnp.bat.

Jacob


--
Jacob Christ
ProLinear/PONTECH, Inc.
1-877-985-9286 Phone
1-413-235-1651 Fax
http://www.pontech.com

Michael Anton

unread,
Nov 15, 2015, 4:43:58 PM11/15/15
to OpenPnP, ja...@pontech.com
For reference the maximum path length in Windows is 1024 characters, which is pretty long.  I've never exceeded it, and my path is huge, but it looks like I am now close to the limit.

Mike

Rich Obermeyer

unread,
Nov 15, 2015, 7:04:44 PM11/15/15
to ope...@googlegroups.com
Not seeing a path larger than 256 possible.  I use WinBlows 7.
Microsoft also does not.  Maybe you can explain how you get around this.
From Microsofts web site.
"Maximum Path Length Limitation

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)"


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/f4099f49-65e6-4cbd-99e8-0317a2b53fad%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Rich

HauntBots

unread,
Nov 15, 2015, 8:23:08 PM11/15/15
to ope...@googlegroups.com
260 is the limitation on "a" path, not "the" path.

260 characters is how far down a file can be buried in the directory structure and still be found.

This is different than the PATH in system environment variables


Pete

Rich Obermeyer

unread,
Nov 15, 2015, 9:35:09 PM11/15/15
to ope...@googlegroups.com
@pete, I didn't know there was a difference, Thx
I think a lot of people are confused about this.
Still don't know where that 1024 came from.

Limitation to the length of the System PATH variable

Details: On computers running Microsoft Windows*, the PATH environment variable size that you can use is 2047 characters. On computers running Microsoft Windows* 7 and later, the maximum PATH environment variable size that you can use is 4095 characters (but the system restart is required).



For more options, visit https://groups.google.com/d/optout.



--
Rich

Michael Anton

unread,
Nov 16, 2015, 6:07:51 AM11/16/15
to OpenPnP
It looks like the 1024 character limit applies to Windows XP, and Server 2003: https://support.microsoft.com/en-us/kb/906469.  Here is another discussion regarding this: http://blogs.msdn.com/b/oldnewthing/archive/2010/02/03/9957320.aspx.  If you do a search in Google for "windows max path length 1024", you will find lots of references to a 1024 character limit for environment variables under some conditions...

I just quoted the first reference I found when looking it up, and assumed incorrectly that it was the same for all versions.  It does however look like the lower limit to OSes that still might be in use.  Though, there is a hotfix to fix it.

Mike

Jason von Nieda

unread,
Nov 17, 2015, 2:40:42 PM11/17/15
to ope...@googlegroups.com
Hi Jacob,

I personally prefer to just link to instructions for dependencies so that I don't have to maintain instructions for them. For instance, we could add a link to https://maven.apache.org/install.html in the Maven section. This covers installation and has information for various operating systems. 

For the PATH issue, I agree with the below posters. I just add everything to my PATH permanently. I've never hit the limit in a couple decades of development on Windows. This is also covered in the Maven instructions.

As for the pre-built binaries, good catch. I will update the docs on that. 

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Jacob Christ

unread,
Nov 17, 2015, 2:45:14 PM11/17/15
to ope...@googlegroups.com
I guess you guys aren't hardcore like me.  Here is my trimmed nearly 2000 character path.

C:\Program Files\Basler\pylon 4\pylon\bin\x64;C:\Program Files\Basler\pylon 4\pylon\bin\Win32;C:\Program Files\Basler\pylon 4\genicam\Bin\Win64_x64;C:\Program Files\Basler\pylon 4\pylonc\bin\Win32;C:\Program Files\Basler\pylon 4\pylonc\bin\x64;C:\Program Files\Basler\pylon 4\genicam\Bin\Win32_i86;%PFX86%\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;%VS110%\VC\;%VS110%\VC\include\;%VS110COMNTOOLS%;%VS110%\Common7\;%VS110%\Common7\IDE\;%VS110%\VC\bin;%AVR%\bin;%AVR%\avr\bin;%AVR%\utils\bin;%PFX86%\Git\bin;%OPENCV%\x86\vc10\bin;%OPENCV%\common\tbb\ia32\vc10;%PFX86%\Microchip\xc32\v1.33\bin;%PFX86%\Microchip\xc16\v1.10\bin;%ANT_HOME%\bin;%JAVA_HOME%\bin;C:\PHP\;%PF%\Common Files\Microsoft Shared\Windows Live;%PFX86%\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%PF%\Intel\WiFi\bin\;%PF%\Common Files\Intel\WirelessCommon\;%PFX86%\EgisTec BioExcess\x64;%PFX86%\EgisTec BioExcess\;%PFX86%\EgisTec Port Locker\x64;%PFX86%\EgisTec Port Locker\;%PFX86%\Windows Live\Shared;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PFX86%\Microsoft SQL Server\90\Tools\binn\;%PFX86%\Microchip\MPLAB C32 Suite\bin;%PFX86%\Common Files\GTK\2.0\bin;%PFX86%\QuickTime\QTSystem\;%PF%\TortoiseGit\bin;%PF%\Microsoft SQL Server\110\Tools\Binn\;C:\Emgu\emgucv-windows-universal-cuda 2.9.0.1922\bin\x86;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\QuickTime\QTSystem\




For more options, visit https://groups.google.com/d/optout.

Jason von Nieda

unread,
Nov 17, 2015, 2:48:46 PM11/17/15
to ope...@googlegroups.com
Good lord! Okay, you win :)

I updated the Developers Guide and Users Guide with the information I mentioned in the above email. If you'd like to add a note about using a batch file for the PATH, please feel free. And in general, you don't need to check with me before updating the Wiki. If someone adds something I vehemently object to (unlikely) I can just edit it.

Jason


greg.hj...@gmail.com

unread,
Sep 21, 2020, 4:51:30 PM9/21/20
to OpenPnP
I am trying to build OpenPNP on windows as well.  I am a C++ programmer so I'm not well versed in the java tools but I think with a little help getting started I can contribute in some way.  I have forked the git repo.  I installed Maven using the instructions on the Developers Guide and installed IntelliJ.  I noticed I have a JDK called "AdoptOpenJDK" installed on my machine so I set a 'JAVA_HOME' environment variable to point to its root directory.  If I type javac on a cmd line I get "javac 14".  If I type java -version on a cmd line, I get:

java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode, sharing)

When I run 'mvn package' on the command line, it appears to build but I'm getting failures on the tests.  I've attached the full output of the build process.    Many of the tests have errors like this: "java.lang.Exception: Error while reading machine.xml (Could not initialize class org.openpnp.vision.pipeline.CvPipeline)"

Greg


openpnp_buld_output.txt

Chris Friday

unread,
Sep 22, 2020, 2:38:15 AM9/22/20
to OpenPnP
Hi Greg,
try using an older Java version. I've got success with jdk-11.0.2.
You can find it here https://jdk.java.net/archive/
Result should look like

After all you should get

Chris

greg.hj...@gmail.com

unread,
Sep 22, 2020, 11:14:08 PM9/22/20
to OpenPnP
Thanks Chris, the build succeeded, all tests passed and I can run OpenPNP.  I don't know if I installed it properly, I had to do a couple 'hacks".  I just unzipped the files into c:\Program Files\Java\jdk-11.0.2 manually and then had to remove C:\Program Files (x86)\Common Files\Oracle\Java\javapath from my path and add this new location to the path.  If there's a more 'correct' way to do this let me know but otherwise I'm happy to be able to build and run the code now!

Greg

Chris Friday

unread,
Sep 23, 2020, 2:16:46 AM9/23/20
to OpenPnP
That`s one correct way, keep going.

Chris
Reply all
Reply to author
Forward
0 new messages