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.

 

 

Something 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 (9)

  1. Chris Pollach @Appeon

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

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. zulmach .

Hi Ivan,
great job finding way to do this.

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

regards

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Miguel Leeuwe

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

  Attachments
Your account does not have privileges to view attachments in the comment
  Comment was last edited about 5 years 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.

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Miguel Leeuwe    Ivan Monnier

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

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Martin Chuquimango

Dear Iván Monnier:
First of all, congratulations on this great article. I have Windows 10 1903 installed on a PC and I have developed an application called Inventories (32bits) in powerbuilder 12.5 whose database is made in MySQL Workbench Community 8.0.21; while on another PC I have Debian 10.2 installed as well as Wine 32 bits. I want to run my application in Debian, could you tell me which would be the variations or the procedure to follow with respect to your described procedure since the connection to the database is done through the ODBC on the first PC. Thanks in advance Iván. I join the zulmach request that you create a video tutorial or through screenshots. Greetings from Peru.

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Ivan Monnier    Martin Chuquimango

Hi Martin,

Very proud to have someone in Peru interested in this.

Forget staying to ODBC 32 bits which is less and less supported under Linux and very prawn to failure somewhere.
The first thing is to switch to JDBC.

Here are the revised steps for 32 bits (which works for 12.5):

Use JDBC Driver



Download JDBC driver from Mysql site https://dev.mysql.com/downloads/connector/j/ (Chose platform independant)
Extract jar file , say mysql-connector-java-5.1.47.jar in C:\Your_jar_location\mysql-connector-java-5.1.47.jar
Install OpenJDK 32 on windows
Your jar file has to be in the CLASSPATH variable, your JVM dll has to be in the PATH variable.
In system environment variables on Windows setup these 2 variables
CLASSPATH=C:\Your_mysql_jar_dir\mysql-connector-java-5.1.47.jar
PATH=C:\Your_java_32bits_JDK_dir\Java\jdk-13.0.1\bin\server



In your PB app when setting up the sqlca object for connection, replace those 2 statements by:
sqlca.DBMS = "JDBC"
sqlca.dbparm = "URL='jdbc:mysql://Your_host/Your_database_name',Driver='com.mysql.jdbc.Driver'"

Your app should now use JDBC on Windows which is much lighter that ODBC.

Then you should follow the steps described , changing every 64 to 32 anytime you see one.

Be careful with every path on every step.

Hope this helps a bit.

  Attachments
Your account does not have privileges to view attachments in the comment
  Comment was last edited about 3 years ago by Ivan Monnier Ivan Monnier
  1. Martin Chuquimango

Dear Ivan:

Very grateful for your answer, I will follow all the steps to the letter of your procedure, and then I will tell you how it went. Again very grateful to you.

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Aleš Vojáček

Does 2019R3 IDE works on wine32?
Sure I can try that, but if someone did please let me know :-)
Thank you

  Attachments
Your account does not have privileges to view attachments in the comment
 
There are no comments posted here yet