Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between 'java' and 'libjvm.so' (Linux) or 'jvm.dll' (Windows)?

Tags:

java

jvm

What are the differences in starting an application through the plain java command, against directly invoking the JVM through libjvm.so in Linux or jvm.dll in Windows ?

Recently I saw on a forum that starting eclipse using the dll or .so file will give better performance. I would like to get to know how this happens.

Thanks.

like image 843
Yohan Liyanage Avatar asked May 26 '11 06:05

Yohan Liyanage


2 Answers

Typically folks build against jvm.dll if they want to wrap their own functionality around a Java core, where sometimes it's hard to do things that look "native" from Java. A good example is indeed Eclipse, where they want to pop up a splash screen and do some other actions before starting up. For other products, it's that Java is only a small part of their workload (eg: large C++ app that needs to bridge into Java at some point).

From a performance perspective, it's irrelevant. It's all about how you want the "fit and finish" for things like Eclipse.

like image 131
Trent Gray-Donald Avatar answered Nov 02 '22 10:11

Trent Gray-Donald


The link discusses Eclipse start-up; it is likely that this is faster because, by using the -vm argument to specify the JRE, the Eclipse executable doesn't have to search the system for an appropriate JRE to launch (which would incur disk I/O and possibly involve detecting the version of the JRE). You aren't speeding up Java, you're speeding up the native launcher.

like image 35
McDowell Avatar answered Nov 02 '22 09:11

McDowell