Results 1 to 2 of 2
- 02-17-2010, 04:18 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 1
- Rep Power
- 0
"Cannot find symbol" errors in Java
Hey, I am making a "simple" FTP Client and, through reading and learning the basics, I have seemingly gotten through most of the simple things. Currently, I am getting compiling errors (Cannot find symbol) in the code shown below, mostly related to the FTPCommand variables in each method below and two others related to the "myIP = myInet.getHostAddress();", "connect(hostname, _defaultPort_);" and "__modes.substring(fileType, fileType + 1));" lines with the bold areas being where the arrow is pointing.
From what I've read, I think I must declare the variables, but when I do that or attempt to, I get more errors. I appreciate the help and responses. Thanks.
import java.net.*;
import java.io.*;
import java.lang.*;
import java.io.IOException;
import java.net.InetAddress;
import org.apache.commons.net.SocketClient;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTP;
public class UIAgent {
public static void main(String argv[]) throws Exception {
}
// Connect to FTP Server
public static InetAddress getLocalHost() throws UnknownHostException
{
InetAddress myInet;
myInet = InetAddress.getLocalHost();
}
public String getHostAddress()
{
String myIP;
myIP = myInet.getHostAddress();
}
public void connect(String hostname) throws SocketException, IOException
{
connect(hostname, _defaultPort_);
System.out.println("CONNECT accepted for FTP server at host and port");
}
public int user(String username) throws IOException
{
return sendCommand(FTPCommand.USER, username);
}
public int pass(String password) throws IOException
{
return sendCommand(FTPCommand.PASS, password);
}
public int syst() throws IOException
{
return sendCommand(FTPCommand.SYST);
}
public int type(int fileType) throws IOException
{
return sendCommand(FTPCommand.TYPE, __modes.substring(fileType, fileType + 1));
}
// Get file from the FTP Server
public int retr(String pathname) throws IOException
{
return sendCommand(FTPCommand.RETR, pathname);
}
// Quit the FTP Server
public int quit() throws IOException
{
return sendCommand(FTPCommand.QUIT);
System.out.println("QUIT accepted, terminating FTP client");
}
}
- 02-17-2010, 07:13 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
Compiling probem "cannot find symbol"
By thegluups in forum New To JavaReplies: 27Last Post: 01-18-2010, 08:53 PM -
Error "can not find symbol variable"
By FullMetalHollow in forum New To JavaReplies: 5Last Post: 10-04-2009, 09:51 PM -
cannot find symbol for "list.addFirst"
By alexbryan_08 in forum New To JavaReplies: 10Last Post: 08-26-2009, 08:55 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
"Cannont find symbol Constructor" error
By Welsh in forum New To JavaReplies: 7Last Post: 01-25-2008, 12:12 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks