I creating a program to work with databases and I am getting the following error when compiling in IntelliJ IDEA. Does anyone why this is happening and how I could solve it?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I must again emphasis the point CrazyCoder has here.
The (Oracle) JVM used to throw a SecurityException when you tried to run a Jar-File containing broken signatures. This made sense from a "What's wrong"-Point of view.
That is no longer the case. They are indeed throwing ClassNotFoundExceptions now - even if the class is right there in the file (no matter if it is in the default package/toplevel or way down in a nested package structure).
The error that you get occurs not on complilation, but when you try to run your application. It happens because Java was not able to find
Table.class
file insidedb
subdirectory of the project output directory (classpath).It can happen for multiple reasons:
Table.java
is excluded from compilation (by accident or intentionally because it contained errors and you wanted to skip it while working on other code)db
subdirectoryTable.java
has incorrectpackage
statement or is located/moved to a different package:
on Mac/Linux or semicolon;
on Windows, it's used to separate the classpath and will render the classpath invalid. See this thread for details. Note that Finder on Mac may display colons in the path as slashes.In a properly configured project and with the correct run/debug configuration everything works just fine: