compiling java package class referring a default package class.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jack_nickelson
Posted On:   Wednesday, December 22, 2004 11:36 PM

Hey, I am trying to compile a java class having a package defination referring a java class with a default package. The code for the default package class is . public class Test{. public static void main(String[] args){ System.out.println("Hello World!"); } } This class compiles fine. I have another class called PackJava, whose code is : package test; import Test; public class PackJava{ public static void main(String[] args){ Test test = new Test(); System.out   More>>

Hey,



I am trying to compile a java class having a package defination referring a java class with a default package.



The code for the default package class is .




public class Test{.






public static void main(String[] args){

System.out.println("Hello World!");


}

}



This class compiles fine.



I have another class called PackJava, whose code is :



package test;


import Test;


public class PackJava{

public static void main(String[] args){

Test test = new Test();

System.out.println("Hello World!");

}

}




I have Test file in the windows path
D:developmentpackagetestexample

and the PackJava java file in the path

D:developmentpackagetestexample est

I have set the CLASSPATH environment varibale as
D:developmentpackagetestexample;.




When I try to compile the PackJava from the
D:developmentpackagetestexample path giving the command as

javac -classpath . testPackJava.java

or

javac -classpath %CLASSPATH% testPackJava.java

it gives me error,


Do any of you have an idea of the parameter i should pass
to the -classpath option


Thanks

   <<Less

Re: compiling java package class referring a default package class.

Posted By:   Anonymous  
Posted On:   Thursday, December 23, 2004 07:41 PM

try to javac testPackJava.java..
About | Sitemap | Contact