79535526

Date: 2025-03-26 06:08:26
Score: 1
Natty:
Report link

It depends on your package design and code.

In case your code is below and save it to /some/where directory.

public class HouseRobber{

}

You need to comple it as below
cd /some/where
javac HouseRobber

Then you can add "/some/where" to your environment parameter "CLASSPATH". So that you can launch your java program from any where.
java HouseRobber

In case your code is like and save thing
package something;
public class HouseRobber{
}

You need to add the directory above something to CLASSPATH. Because java will search something.HouseRobber from the directories in CLASSPATH .

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Peter