New Class works in the IDE but not in runtime [message #1843060] |
Tue, 13 July 2021 14:25  |
Eclipse User |
|
|
|
Eclipse Juno
Oracle 12C
PostgreSQL v12
Windows 10, 64 bit platform
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.
I've attached images in the PDF file, and the Class file itself.
Details:
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:
|
|
|
Re: New Class works in the IDE but not in runtime [message #1843275 is a reply to message #1843060] |
Thu, 22 July 2021 07:44  |
Eclipse User |
|
|
|
Juno was the 2012-2013 release. Java 8 came out in 2014. I don't know why you're using an ancient and unsupported release of Eclipse,
one that predates the release of Java you're using, but you can still build a Java 8 project in the latest release of Eclipse, so at least try that.
|
|
|
Powered by
FUDForum. Page generated in 0.08297 seconds