Results 1 to 5 of 5
Thread: problem with package
- 06-27-2011, 01:21 PM #1
Member
- Join Date
- May 2011
- Posts
- 5
- Rep Power
- 0
problem with package
I m using these two files hello.java helloimpl.java in a directory named pkgtest.However when i m compiling helloimpl.java it gives me a compilation error.I m using package statement at the top of the files however if i dont use package statement then code works fine.its really bugging me whts wrong??
code for hello.java
package pkgtest;
import java.io.*;
public class hello{
public void SayHello()
{
System.out.println("hello world");
}
}
/* code for helloimpl.java */
package pkgtest;
import java.io.*;
class helloimpl{
public static void main(String args[])
{
hello hi = new hello();
hi.SayHello();
}
}
- 06-27-2011, 01:32 PM #2
How are you compiling the programs? Does the classpath point to the folder containing the pkgtest folder?
- 06-27-2011, 01:35 PM #3
Member
- Join Date
- May 2011
- Posts
- 5
- Rep Power
- 0
yeah i m giving class path in the compiltation as
javac -classpath /user/home/myname/pkgtest/
pkgtest is the directory in which the code files are
- 06-27-2011, 02:01 PM #4
Did you read my post?
Does the classpath point to the folder containing the pkgtest folder?
- 06-27-2011, 02:10 PM #5
Member
- Join Date
- May 2011
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
a problem with package
By saolion in forum NetBeansReplies: 0Last Post: 05-03-2011, 12:17 PM -
Eclipse package problem
By Ratul in forum EclipseReplies: 0Last Post: 02-15-2011, 08:03 PM -
Package problem
By Vizualni in forum New To JavaReplies: 4Last Post: 08-30-2010, 11:48 AM -
Client to Server, ClassNotFound Package Problem
By pwnzer in forum New To JavaReplies: 3Last Post: 11-07-2009, 09:17 PM -
Problem With Package
By acp26b in forum New To JavaReplies: 3Last Post: 07-14-2008, 05:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks