User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

 

From Windows to Linux 

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 :

  1. A valid Powerbuilder 2019 installed somewhere on a Windows machine
  2. A Linux desktop with a graphical environment installed
  3. your PowerBuilder 2019 app
  4. A JDBC driver as a .jar library
  5. An Open JDK distribution for Windows 64 bits
  6. Wine64



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

On 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)

atl100.dll
ATL80.dll
libjcc.dll
libjutils.dll
msvcp100.dll
msvcp80.dll
msvcr100.dll
msvcr120.dll
msvcr80.dll
nlwnsck.dll
pbdpl190.DLL
PBDWE190.DLL
PBDWM190.DLL
pbdwr190.pbd
PBJDB190.DLL
pbjdbc12190.jar
PBJDC190.DLL
PBjvm190.DLL
pblab190.ini
pbo10190.DLL
pbo90190.DLL
PBODB190.DLL
pbodb190.ini
PBODW190.DLL
PBRTC190.DLL
PBSHR190.DLL
PBSNC190.DLL
PBSYC190.DLL
pbtheme190.dll
pbtra190.DLL
PBUIS190.dll
PBVM190.DLL

 

Install wine64 

On Linux.

Run as su under the user who will use wine:

apt-get update

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.

wine64 --version

 

Create 2 directories under wine

On Linux.

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

On Linux.

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

On Linux.

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

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 :

wine regedit

CLASSPATH=C:\Software\Mysql\mysql-connector-java-5.1.47.jar

PATH=C:\Software\Java\jdk-13.0.1\bin\server

 

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

myapp

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.

 

 

Summary

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.

Comments (5)

  1. Chris Pollach

Note: Only for PB Apps ... not the IDE.

 
  1. zulmach .

Hi Ivan,
great job finding way to do this.

you should create video about it
or at least show some scheenshot

regards

 
  1. Miguel Leeuwe

This is nice!
May I ask: why wine64, wine32 won't work?
regards

  Comment was last edited about 3 weeks ago by Miguel Leeuwe Miguel Leeuwe
  1. Ivan Monnier    Miguel Leeuwe

Give it a try : Change 64 to 32 wherever you see a 64.

The thing is that we have been doing this for years with Powerbuilder 12.5 but we were encountering more and more issues on different platforms, since 32 bits in generally is less and less supported.

I know it works fine on 32 bits on Debian that i all I can guarantee.

The ability to generate 64 bits apps was the thing that made us switch to Powerbuilder 2019. Our life is now much easier.

 
  1. Miguel Leeuwe    Ivan Monnier

I see, ok, I'll give it a try, thanks!

 
There are no comments posted here yet