opentable / otj-pg-embedded

Java embedded PostgreSQL component for testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No Postgres binary found for Windows / x86

andrewriver opened this issue · comments

When running mvn clean install I'm getting this error in one of my tests where I use embedded postgres. I think is something related with Unable to run on Windows or Illegal State issue from initdb, but I haven't found the solution regardless the actions suggested there.

Environment:

  • Windows Server 2016 Datacenter x64
  • Java 8
  • Maven 3.6.3
  • otj-pg-embedded 0.13.3

Error:

 INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - Detected a Windows x86 system
<<< ERROR!
java.lang.IllegalStateException: No Postgres binary found for Windows / x86

Any help would be so appreciated.
Thanks.

We don’t support 32 bit sorry .

Thanks @mikebell90 , but my system is not 32bit:
system

@andrewriver ,
this most likely happened since system property for os.arch is x64, while EmbeddedPostgres expects x86_64 as t tries to match your OS parameters against the following supported binaries:

postgresql-Darwin-x86_64.txz
postgresql-Linux-x86_64.txz
postgresql-Windows-x86_64.txz

So if you manually set the system property os.arch to x86_64, it will find the required binary file and launch it successfully.

@pumbabughunter Thank you for your suggestion.
Couple of days ago I realized that I had installed the windows x86 JDK version.
I downloaded and installed x64 JDK version and that worked! 😅

@andrewriver Hey, Can you please explain the steps you have followed to solve the issue

Hey @cher1998, I had the same issue and what I did to fix it was:
1.install x64 JDK version
[https://www.oracle.com/java/technologies/java-archive-javase10-downloads.html]
2. (I use eclipse) changed in the project properties the version it shoud use
[Right click your project > properties
Select “Java Build Path” on left, then “JRE System Library”, click Edit…
Select "Workspace Default JRE"
Click "Installed JREs"
If you see JRE you want in the list select it (selecting a JDK is OK too)
If not, click Search…, navigate to Computer > Windows C: > Program Files > Java, then click OK
Now you should see all installed JREs, select the one you want
Click OK/Finish a million times]
and done...

As noted we've released 1.0.0 which is testcontainers based. We expect this resolves the issue, assuming postgres maintains an x86 docker image, and while PRs are welcome against the legacy branch, we are not planning on formally maintaining pre-1.xx code base.