tarunbod
tarunbod

Reputation: 67

Java jar files without libraries

I've been wondering about this for a while. How do some jar files work without their required libraries compressed inside them or in the same directory as them? For example, bukkit plugins. Every time i make one, i include the bukkit library. But whe nthe jar file is made, there is no trace of the bukkit library inside the jar file.

Upvotes: 0

Views: 153

Answers (2)

Powerlord
Powerlord

Reputation: 88806

The classpath of the Java interpreter determines what libraries it will load. This is set when Java starts.

Or rather, that would be the generic answer. In the case of your addon, it's being loaded from Bukkit, so Bukkit/Minecraft is already loaded in memory.

Upvotes: 0

Lohmar ASHAR
Lohmar ASHAR

Reputation: 1771

there is a similar question here Confusion in understanding classpath. It's all in understanding what the CLASSPATH is and how it works, try to take a look at this page that explains how the classes are "searched"/loaded http://docs.oracle.com/javase/6/docs/technotes/tools/findingclasses.html

.

Upvotes: 2

Related Questions