|New Class works in the IDE but not in runtime [message #1843060]
||Tue, 13 July 2021 18:25
| Olan Knight
Registered: September 2016
Windows 10, 64 bit platform
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.
I've attached images in the PDF file, and the Class file itself.
I have Java code that 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.
I can SEE the org.postgresql.Driver class in the Package Explorer.
If we do NOT have a ClassNotFoundException() CATCH block coded in the class, the Class file has an error when attempting to compile:
Powered by FUDForum
. Page generated in 0.03186 seconds