Did you know that Powerbuilder 2019 could run on Linux ?
Since Powerbuilder 2019 is now in 64 bit, it is now a lot easier to run on Linux using wine64
Here are the main steps to make generated Powerbuilder 2019 apps run on Linux.
What do you need ?
You will need :
- A valid Powerbuilder 2019 installed somewhere on a Windows machine
- A Linux desktop with a graphical environment installed
- your PowerBuilder 2019 app
- A JDBC driver as a .jar library
- An Open JDK distribution for Windows 64 bits
Use JDBC Driver
In Powerbuilder environment
Your Powerbuilder app has to use JDBC, it is much simpler than ODBC under Linux (Wine supports it though). Refer to JDBC section of this part of the documentation
JDBC needs a JDK to be used, part of the following actions is about installing a JDK under wine.
Generate code in 64 bits
In Powerbuilder environment
In the project painter , select "64 bit" in the "Platform" drop down list
Deploy your Powerbuilder app under Linux
Copy your .pbd and .exe files on Linux in c:\my_app_dir
Copy the needed 64bits DLL in the same directory c:\my_app_dir.
All your DLLs must be 64bits (otherwise you get an error c000007b ) . Pick them from a windows10 install of Powerbuilder from C:\Program (X86)\Appeon\Shared\Powerbuilder\x64
Here is the DLL list I needed to connect to ODBC, JDBC, Mysql, Native Sybase and Oracle (our app can handle all of them)
theme190 (the directory containing new 2019 themes, despite they are not rendered under Linux)
Run as su under the user who will use wine:
apt-get install wine wine32 wine64
disconnect from root and go back to the normal user.
Run it one to create the ~/.wine directory in your HOME.
Create 2 directories under wine
the ~/.wine directory simulates the disk organization under windows. Create 2 directories there:
mkdir -p ~/.wine/drive_c/Software/Java
mkdir -p ~/.wine/drive_c/Software/Mysql
Copy your JDBC driver under wine
copy your jar file (Mysql for me) under wine
cp mydir_somewhere/mysql-connector-java-5.1.47.jar ~/.wine/drive_c/Software/Mysql
Copy the OpenJDK under wine
Download JDK from https://openjdk.java.net/ . Pick the Windows 64 bits version of the distribution, as a zip file.
Unzip the file and copy the OpenJDK distribution (the directory right above the bin directory) under wine
cp mydir_somewhere/jdk-13.0.1 ~/.wine/drive_c/Software/Java
Setup Windows environment variables on Linux
Your jar file has to be in the CLASSPATH variable, your JVM dll has to be in the PATH variable.
For this use regedit and edit the 2 keys under HKEY_CURRENT_USER/Environment :
Create alias to launch your app
Add these lines to your .bashrc
alias myapp='cd the_directory_where_my_.exe_file_is ; wine64 myapp.exe &'
Launch your app
use the alias that you just created
You should see the first window of your app.
Somthing wrong ?
- error c000007b : One of your DLL is not 64bits. Pick it up from a windows10 install from C:\Program (X86)\Appeon\Shared\Powerbuilder\x64
- Could not initialize JVM: CLASSPATH or PATH variables are not defined properly. Check them. Another reason is that you picked up a 32 bits JDK.
Here is how to install a Powerbuilder 2019 generated app.
It is not very difficult for a regular unix fellow.
You will see that your app runs surprisingly well under Linux, even on a less powerful desktop.