Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol  RSS feed

 
bill steve
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple program developed in NETBEANS that uses commons-net classes. It works and the beginning looks like:

import org.apache.commons.net.ftp.*;
import java.io.*;

/**
* submit a batch job
*/
public class submitmainframebatchjob {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {

String serverName ="amsmvsb.amsinc.com" ;
String userName ="pvbsles" ;
String password ="smiling0" ;
FTPClient ftp = new FTPClient() ;
etc.....



I'm trying to do the same with an application with a GUI; Again i used NETBEANS, and created a "java application", which added a bunch of code which is complicating things.

I added the following ocde, indentical to the other program, but in this case FTPClient cannot be resolved. I'm importing org.apache.commons.net.ftp. just like in the first program.

i thought that should allow it to find FTPClient. but Noooooo.

ideas?

import org.apache.commons.net.ftp.*;


/**
* The application's main frame.
*/
public class OnDemandView extends FrameView {

public OnDemandView(SingleFrameApplication app) {
super(app);

String serverName ="amsmvsb.amsinc.com" ;
String userName ="pvbsles" ;
String password ="smiling0" ;
FTPClient = new FTPClient() ; (says it can't find FTPClient)
 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My idea is that this is incomplete information.

IF you were importing that package as you say, and if it were the same package as documented for the apache project library, then yes, FTPClient should be found. So there's something else going on.

Why don't you post the error message that you get, instead of your interpretation of the error message that you get, for a start. Copy-and-paste from somewhere to the forum is best, for several reasons.

rc
 
Paul Clapham
Sheriff
Posts: 22491
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Incomplete, yes. However the most likely explanation is that the jar file for the Apache project isn't in the classpath at compile time. How you specify the classpath for a Netbeans project is something that I don't know, but if that turns out to be the actual question, maybe we could move the thread to the forum which covers IDEs.
 
bill steve
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much for your responses. After reading your responses i went to reproduce my error message. upon looking at the code, i saw the problem.

i somehow typed

FTPClient = new FTPClient() ;

should have been

FTPClient ftp = new FTPClient() ;


it helped to know that it should have worked, so at least i knew i wasn't out in left field.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!