An error appears at the beginning of the program with the type XXXXX cannot be resolved. It is indirectly referenced from required. class files
Cause: The class control that is being used calls another class within the package modbus4j, and the class calls the other classes, and the relationship can be a lot of layers. In the process of this invocation, the absence of a package containing a class can cause the error. Or. jar Package import path error, or JRE version selection error.
Workaround:
Check the JRE version
Because of Java updates, different versions of the JRE may exist in the same directory, choosing the latest version.
Importing a missing package
1. Place the appropriate package under the C:\Program Files\java\jre8\lib\ext folder in the Java installation directory
2. Open Eclipse Project Properties Java Build Path (Libraries)
3. Click the button for the add external jar
4. Locate the package you just placed under the C:\Program Files\java\jre8\lib\ext folder and select
5. Select OK, libraries This column will appear this. jar, then expand this item, click Native Library location
6. Find the project directory you need to import this package, click OK to complete the import of the external package.
Jar Package Import