• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

package ?


Hi,
 I have a simple java prog. in which 1st statment is

package com.utils;
public class Util {
...........
............
}

when I compile my prog from c:\> it is creating .class file in c:
 Why it is not creating a class file inside c:\com\utils ???

 Wheather I have to manually create those dir ?
Thanx
0
rameshaa
Asked:
rameshaa
1 Solution
 
cherch0rCommented:
You have to save the Util.java file under com/utils under your root and then compile it.
0
 
Ravindra76Commented:

Hi Ramesh,

 type

 javac -d . Util.java

 when compiling.

Now it will create class file whatever the directory you mentioned.


Now you can run like this.

1.java com.utils.Util
 
  or

2. java Util
   after going to com\utils directory.



Best of luck
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now