Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compile error ! - kindly help

 
Muthuvel Ramamoorthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i study HF servlets & JSP for the scwcd.

i have the directroy structure as follows

VProject --> src --> com--> example-->web-->select.java (servlet source code)
VProject --> src --> com--> example-->model-->expert.java (java source code)

VProject --> classes --> com--> example-->web-->select.class (servlet class file)
VProject --> classes --> com--> example-->model-->expert.class (java class file)

When i compile servlet source code after adding import com.example.model.*;
i am getting the compile error saying that package com.example.model does not exist.

Which causes for this error, kindly assist..

Thank you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"VProject --> src" has to be in the CLASSPATH
 
Cai DongShan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the following commands at folder VProject.

javac -d .;classes src/com/example/model/expert.java
javac -d .;classes src/com/example/web/select.java
 
Muthuvel Ramamoorthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still i am getting the same compile error.

Please help to solve this error.

thank you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have SCJP ? you should know how to set the CLASSPATH

http://faq.javaranch.com/view?HowToSetTheClasspath
 
Muthuvel Ramamoorthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank you , its getting thro.

the link you provided really helped me to find out my mistake. I used so colon so far and thats why.

"Note that different class file location values should be seperated with a semicolon on a Windows machine (not with a colon as is used with Linux).
"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic