Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where java compiler keeps its import mapping

I am new to java. I want to know when I write

import {SOME_PACKAGE_NAME}

where does it search for the folder? Is there any general folder or mapping file where it search for given package?

like image 864
ZINDA ROBOT Avatar asked Feb 10 '23 03:02

ZINDA ROBOT


1 Answers

All the directories of your project and from Jar's will be added to class path. From there classes being imported from the classpath.

You will see errors if compiler doesn't found them at compile time.

If they are not found at runtime ClassNotFoundException's/NoClassDefFoundError's based on the case occurs.

like image 95
Suresh Atta Avatar answered Feb 11 '23 16:02

Suresh Atta