Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Classpath Question for commons-net-1.4.0

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have downloaded the commons-net-1.4.0.jar archive as I need to be able to ftp to a remote host from within my java program. However upon trying to compile my source code I get the error message :

C:\FTPTesting\ package does not exist

I presume this is related to me not setting the classpath correctly but I have little understanding of how this should be set and what exactly it does.

My specific questions are then.

1> Where do I copy the commons-net-1.4.0.jar file to on my C: drive, is there a specific loction where it needs to be ?.

2> My source code is in the Directory C:\FTPTesting and I am compling it from this directory also, how do i set the classpath so that it can always find the commons-net-1.4.0 library and what command do i use to set it up ?


Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several ways to do this. A simple one would be to put the Net jar file into C:\FTPTesting, and compile and run with:

javac -classpath commons-net-1.4.0.jar *.java

java -classpath .;commons-net-1.4.0.jar getDataFiles
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RE: #2 - To make the classpath setting permanent, you need to modify your environment variables. Go into Control Panel, double-click System, click the Advanced tab, then the Environment Variables button. Edit the variable CLASSPATH (or add it if it doesn't exist) and append ";C:\path\to\commons-net-1.4.0.jar" to the current value.
I don't always make ads but when I do they're tiny
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic