- Modular Programming in Java 9
- Koushik Kothagal
- 139字
- 2021-07-02 18:38:22
Handling possible errors
Here are some possible errors you could run into when following the steps we previously outlined, along with some solutions:
- Error during compilation:
javac: invalid flag: --module-source-path
This is probably because you haven't switched to JDK 9 and are still using the Java 8 compiler. The --module-source-path option has been newly introduced to javac as of version 9.
- Error during compilation:
error: module not found: packt.addressbook
This error is because the Java compiler is unable to find the module-info.java file. Make sure it is in the right directory path.
- Error during runtime:
Error occurred during initialization of VM java.lang.module.ResolutionException: Module packt.addressbook
not found
This error indicates that the module file is not available in the module path provided. Make sure the path is correctly specified and that the packt.addressbook folder contains the compiled module-info.class file.
推薦閱讀
- HTML5+CSS3王者歸來
- 碼上行動:零基礎學會Python編程(ChatGPT版)
- 技術領導力:程序員如何才能帶團隊
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- Building a Recommendation Engine with Scala
- Java性能權威指南(第2版)
- Python機器學習算法與實戰
- Instant Ext.NET Application Development
- C++ System Programming Cookbook
- LabVIEW數據采集
- INSTANT JQuery Flot Visual Data Analysis
- Greenplum構建實時數據倉庫實踐
- PHP 7 Programming Blueprints
- Internet of Things with Arduino Cookbook
- C語言進階:重點、難點與疑點解析