Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Carlton Martinez   on Dec 12 In Java Category.

  
Question Answered By: Cheri Garcia   on Dec 12

Because you are using a package in your program, just remember these points
- You have to set classpath to the folder containing your package.
- You have to compile ur program with full directory information.
- While running also u have to prefix you package name.

(by the error  message u attached i can make out that u forgot to prefix ur
package name with class  name)

fox ex. if your program is in "C:\JavaPrograms" folder & ur package name is
"aim" --try this

1. You have to set classpath to the folder containing the package, so
set classpath=%classpath%;C:\JavaPrograms;

2. Compiling
javac -d C:\JavaPrograms aim_basic.java

3. Running
java aim.aim_basic

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on compilation error Or get search suggestion and latest updates.


Tagged: