• Post Reply Bookmark Topic Watch Topic
  • New Topic

Package importing error  RSS feed

 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have created my saperate directory for java project like this
C:\Java\src\com\project
where as src directory contains all .java file and project directory contains all .class file, then i have create two file in src like filecreation.java and LogFile.java, i have import package com.project in both, but what happen when i compile LogFile.java, it success but for filecreation.java gives error can not resolve symbol LogFile, i also import com.project.LogFile in filecreation.java, the purpose of filecreation is to create text file and errorfile related to database connection.
My class path is C:\j2sdk1.4.0_03\bin
What should i do to get result.

Thanx.
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nitin,

then i have create two file in src like filecreation.java and LogFile.java, i have import package com.project in both,
Does that mean you've created a package called com.project by adding the following line in both files?


but what happen when i compile LogFile.java, it success but for filecreation.java gives error can not resolve symbol LogFile,
Could you find LogFiile.class under c:\java\src\com\project directory? If not, place it there and compile filecreation.java.

Or you can use -d option to specify where to place the generated class files. Try this:
c:\java\src\javac -d . *.java

Joyce
[ December 24, 2004: Message edited by: Joyce Lee ]
 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Joyce,

My package importing problem is solved as per your solution.

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