1. Juan Carlos Rojas
  2. PowerBuilder
  3. Tuesday, 24 September 2019 00:49 AM UTC

I am trying to run a java class from powerbuilder and I have seen examples where this statement is used:

javavm i_jvm.
When compiling, this error message appears: Illegal data type: javavm.
What should I do to be able to instantiate the java virtual machine?
Please.
Thank you.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 24 September 2019 01:22 AM UTC
  2. PowerBuilder
  3. # 1

Hi Juan;

   Did you add the PBJVMnnn.pbd to your Apps library list (where nnn = PB version)?

Regards ... Chris

Comment
  1. Juan Carlos Rojas
  2. Wednesday, 25 September 2019 03:42 AM UTC
Hi.

I already looked at the example you told me. I ran it using the .exe file and I also created a workspace in Appeon 2017 r2 build 1769 and it worked fine although some messages appeared indicating that I should not run it in this version.

However, there are things that I do not understand, within all the code there is. For example, what is the go_ac object? I created a new workspace to try to simplify the code and understand better but I have not succeeded. Can you tell me if it's okay to create the go_ac object and then use the code in the wn_pb2java_e window to call the HelloWorld class? please.

Thank you.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 25 September 2019 15:03 PM UTC
Hi Juan;

The PB2017R3 example was built with an older JavaC compiler but I tested it with the Java 1.8.0_144 JRE. When I migrated the code last night to PB2019, I also received some run time warnings from the JVM and it created an error.log file as well for these run-time issues (warnings). What I did from there was upgrade my Java environment to JRE1.8.0_201 that also included the Java SDK of the same version (that has the JavaC compiler). After I rebuilt all the Java Classes with that Java SDK version and then ran the PB2Java test application again with the matching JRE versoin, all the run-time warnings (including a Java error log) went away.

FYI ... Java 1.8 SDK & Runtime: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

I will be posting the updated PB2Java for PB2019 example up to SourceForge later today. So if you (or anyone else reading this thread) are interested in the PB2019 flavour, you'll be able to grab the latest version for PB2019.

HTH

Regards ... Chris



  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 26 September 2019 00:50 AM UTC
Hi Juan;

FYI: I have now released today the PB2019 version of the PB2Java example: http://chrispollach.blogspot.com/2019/09/pb2j.html

Note that I also upgraded my Java JDK/JRE to version 1.8.0_221 - a 64bit version of the JVM to compile & run the Java classes.

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.