0

I created a file deleteitems.java inside the directory servlet.

There is a file called db.java in the directory 'dao.

In deleteitems.java I imported db.java file(import dao.db)

This is the directory structure Classes

├───dao
│       db.java
│
└───servlet
        deleteitems.java

How to compile in command line I'm inside servlet directory. It throws me the error package dao does not exist

1
  • You need to either explicitly specify the classpath, or run the compiler from the parent directory. Commented Jul 18, 2015 at 18:26

2 Answers 2

0

Your anser is here.

If you using javac you must set classpath. In the theard that i gave above, janos explins in detail what and how

Sign up to request clarification or add additional context in comments.

Comments

0

Make sure you have declared package declaration on db.java "package dao;".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.