Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath probs

 
sthitaprajna Das
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone
can anybody get my funda clear regardin classpath setting.
wheteher i should create them by setting environment variables or create a batch file for it or whether i hav 2 set the classpath each time in the cmd prompt when i login.
i am not able to understand the difference between these approaches.
which will be easier one?
I am not able to throw my class files in to appropriate folder using -d options as well.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a matter of preference really.
It also depends on the project.

For small quick apps, its easy to use the compiler's -cp switch.

Once a project has more than 2 or 3 dependencies it starts making sense sense to write a shell script (or a batch script) to set up a CLASSPATH environment variable that can be sourced from the window you will using to run javac.

If a particular workstation is only ever used for one project (rare) it might make sense to set up the environment variable from the login scripts (or My Computer in the case of Windows).

There is a FAQ entry that covers compiling servlets (with a link to the classpath FAQ from the Java In General forum).
Here:
http://faq.javaranch.com/view?CompilingServlets
[ December 03, 2005: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One word: Ant.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic