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

Java folder naming convention

 
Sonali Bendre
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just starting with my first servlet application. I tried to create my application with name "HelloAppl".
The folder structure was:
HelloAppl/src/com/example/model/GetHelloPic.java
HelloAppl/src/com/example/web/HelloApp.java
And the program HelloApp.java included a line
import com.example.model.*;

I compiled GetHelloPic.java and it went fine. But when I tried to compile HelloApp.java, it gave me error
package com.example.model does not exist. And another error as "Cannot find symbol GetHelloPic"

I renamed the folder as beerV1 and it the program compiled fine.
I tried changing folder name to several others and it did not work.
Are there any folder naming conventions? If yes, what are those rules?

Any help will be appriciated.
 
sachin kelkar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add in your classpath path,
set classpath=c:\ \ \com\eample\model\GetHelloPic.class;
So that package will be loaded.
Then compile it.

c:\ ..\HelloAppl\src>javac -classpath \com\example\model\ \com\example\web\HelloApp.java

If you still confused with this.try out small example.
Look in specification (Javac) tools

Nregards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic