Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference of compile time libraries and run time libraries in java?

Tags:

java

netbeans

And what are the pro's con's of using either?

I actually saw it in Netbeans under Project Properties > Libraries for Java Applications. We have two tabs, one for compile time libraries and run time libraries, and it looks like we can add a library to either independent of each other

like image 316
jonasespelita Avatar asked Jun 22 '10 03:06

jonasespelita


People also ask

What are the main differences between compile time and run time storage?

Compile-time and Runtime are the two programming terms used in the software development. Compile-time is the time at which the source code is converted into an executable code while the run time is the time at which the executable code is started running.

What is the difference between running and compiling code?

Compiling is the process of transforming C language source code into executable code. Running is the process of executing the executable code. Compilation needs to be done only once to produce the executable code. The executable code thus produced can then be run multiple times.

What is the difference between compile dependency and runtime dependency?

Compiletime dependencies are only the dependencies (other classes) which you use directly in the class you're compiling. Runtime dependencies covers both the direct and indirect dependencies of the class you're running.

Is JVM runtime or compile time?

Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the Java Code or applications. It converts Java bytecode into machines language. JVM is a part of Java Runtime Environment (JRE). In other programming languages, the compiler produces machine code for a particular system.


1 Answers

There is no such a thing as compile time libraries vs. runtime libraries

Perhaps you're mixing some concepts.

In Java the libraries to be used are statically validated at compile time and also validated at runtime.

For instance if you want to use IterableMap specified in the Apache Collections library. The compiler validates "at compile time" you are invoking a method that exist in that class.

But the compiler doesn't link or do much of anything with that library, you still need it at runtime. So, when your code executes, the Java runtime, searches for that class again, and invokes the method the compiler verified existed.

And that what there is.

like image 87
OscarRyz Avatar answered Oct 14 '22 02:10

OscarRyz