I’m writing a small project for my office. Java Eclipse 2024-6
When I try to run the following code the FTPClient cannot be resolved to a type. However the needed jar is referenced and intelisense sees no errors, no red underlines, any suggestions
`private void connect(){
FTPClient ftpClient = new FTPClient();
try {
USERNAME= txtUserName.getText();
SERVERADDRESS = txtUserName.getText();
PASS = txtPassword.toString();
// Connect to the FTP server
ftpClient.connect(SERVERADDRESS, PORT_NUM);
ftpClient.login(USERNAME, PASS);
// Set file transfer type to binary
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
// Disconnect from the FTP server
if (ftpClient.isConnected()) {
ftpClient.logout();
ftpClient.disconnect();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}`
Checked all references to the needed jar file Opened and closed the project. Closed and deleted from workspace and then readded. Maven project and dependencies are added to the pom.xml
Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.