1. Olan Knight
  2. PowerBuilder
  3. Tuesday, 13 July 2021 17:48 PM UTC

PowerBuilder v12.1 & PBv2019R3
Oracle 12C
PostgreSQL v12
Windows 10, 64 bit platform

I know this is not an Eclipse forum, I'm just hoping someone knows an Eclipse expert that would be willing to help me!!!


Summary:
I need an Eclipse expert to tell me what I'm doing wrong with my Class file!
An imported class is apparently not seen by the compiler in Eclipse, AND never shows up in the runtime JAR.

Details:
Our PB application invokes Java code using the RUN command. Don't laugh, it works.  :)

The Java code is written and compiled using Eclipse Juno. I inherited this setup, and I get into the Java code about twice a year. I'm Java certified, but not Eclipse certified.


I created a new class to connect to a PostgreSQL database; I used an existing Oracle connection class as a template. The issue is that the new class works perfectly in DEBUG mode or in "Run as a Java application" mode, but not in runtime when the Java process is running from a JAR file. In other words it works fine when running in the Eclipse IDE but it fails in runtime.

I suspect that something simple needs to be done in Eclipse to get the new PostgreSQL JAR file seen and accepted, but I don't have the foggiest notion of what that might be. And that's why I calling for an Eclipse expert!

The PostgreSQL driver JAR file is in the build path.
The PostgreSQL driver classes are imported into the new Class file.

If we do NOT have a ClassNotFoundException() CATCH block coded in the class, the Class file has an error:

The error on line 81 is "Class not found".
This occurs even though the specified JAR file is being imported and we can SEE the "Driver" class in the left pane!!!!



The runtime error is always "Unknown Source" / "Class Not Found exception"

 

Here's the Build Path in Eclipse: