aspose file tools
The moose likes Beginning Java and the fly likes Doubt about package compilation in another drive Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Doubt about package compilation in another drive" Watch "Doubt about package compilation in another drive" New topic
Author

Doubt about package compilation in another drive

Harivenkatesh Polnati
Greenhorn

Joined: Mar 17, 2012
Posts: 20

I created Three Programs in three different directories like below:

1)In C Drive I saved below program

package pack1.pack2;
public class Cdrive
{
public void m1()
{
System.out.print(" you are in C drive");
}
}

2) In D drive I saved below program

package pack3.pack4;
import java.pack1.pack2.Cdrive;
public class Ddrive {
public void m2()
{
Cdrive cd = new Cdrive();
cd.m1();
System.out.println("D drive you are in");
}}

3)In E drive I saved like below program

import pack3.pack4.Ddrive;
public class Edrive
{
public static void main(String args[])
{
Ddrive dd = new Ddrive();
dd.m2();
System.out.println("you are in E drive");
}
}

Now my Question is How to Compile and run above programs from the Directory "E:"?
I tried in lot of ways but I didn't get.
please answer
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3041
    
    4

You have to set the classpath to include all three locations where the packages are located.


Steve
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Doubt about package compilation in another drive
 
Similar Threads
Strange for loop behavior
Trouble with packages.
package trouble
package problem
Compiling java files in different packages with single javac command