Javac/Java searching algorithm for other classes


With this post, I would like to explain how exactly the Java/Java will search for its dependencies in the project or application level. Java Applications can be run using the command line or in the Web/Application servers. For both the scenarios will be covered as below:

When you are accessing standalone application using command prompt, below will be the search criteria steps:

Step 1: The first place that look in the directories that contains the classes that come with Java SE.

Step 2: The classpath that declared as command line options for either Java/Javac. Since the classpath declared in command line options override the classpath declared in command line options persists only for the length of the invocation.

Step 3: Looks for the the default classpath that declared as System Environment Variables.

When you are accessing the application from Web or application servers, below will be the search criteria steps:

Step 1: The first place that look in the directories that contains the classes that come with Java SE.

Step 2: If the dependencies not able to identify in the JRE lib folder, then it will be looked into the Application lib folder.

Step 3: If the dependencies not able to fine in above two steps, then it will be looked into Web/App server lib folder.

 

Other Useful Links:

Differences between Object and Instance
Difference between Abstract Class and Interface:
Threads Interview questions in Java
Access Specifiers in Java
Avoid nested loops using Collection Framework in Java

Advertisements
About

I born in Good cultural place called India. My family is traditional family. We fallow all Indian traditions.

Tagged with: , , , , , ,
Posted in JAVA
4 comments on “Javac/Java searching algorithm for other classes
  1. Divya says:

    Nice article…. Very helpful….

  2. […] Javac/Java searching algorithm for other classes […]

  3. […] Javac/Java searching algorithm for other classes […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 678 other followers

Calendar
October 2013
M T W T F S S
« Aug   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  
Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Blog Stats
  • 271,320 hits
IndiBlogger
malliktalksjava.wordpress.c...
70/100