aspose file tools*
The moose likes Beginning Java and the fly likes Package compilation - urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package compilation - urgent" Watch "Package compilation - urgent" New topic

Package compilation - urgent

saquib nisar

Joined: Nov 13, 2000
Posts: 14
I have the following setup:
Directory c:\project1 containing my Java sources
java source files with package com.caluk.utils as the first line.
When these compile they (i.e. the class files) get written to directory c:\project1\com\caluk\utils (using JCreator)
However, if I do a compile of a java source file which imports one of these files (using import com.caluk.utils.*), I get the following errors:
1) If I add c:\project1\com\caluk\utils to my classpath I get a bad class file error
2) Without changing the classpath I do get errors indicating that the class files cannot be found.
What am I doing wrong? Do I need to change the classpath, or should it just work?
Saquib Nisar

Joined: Nov 14, 2000
Posts: 12
You need to put your java source file and the package in the same directory level. You dont have to edit the path for this to work. Just include the source file and the package in the same level.
I agree. Here's the link:
subject: Package compilation - urgent
Similar Threads
Help needed setting classpath
importing a package
running a servlet without IDE
running java program out of workspace
Error with running batch file from Java class