首页 > TAG信息列表 > JLI

java命令的本质逻辑揭秘

前言 在日常编码中,有了ide的支持,我们已经很少直接在命令行中直接执行java XXX命令去启动一个项目了。然而我们有没有想过,一个简单的java命令背后究竟做了些什么事情?让我们看下下面几个简单的问题 1.java命令之后可以跟很多参数,那么这些参数是如何被解析的?为何-version会返回版本

JVM系列(一):jvm启动过程速览

  jvm是java的核心运行平台,自然是个非常复杂的系统。当然了,说jvm是个平台,实际上也是个泛称。准确的说,它是一个java虚拟机的统称,它并不指具体的某个虚拟机。所以,谈到java虚拟机时,往往我们通常说的都是一些规范性质的东西。   那么,如果想要研究jvm是如何工作的,就不能是泛泛而谈

《jdk8u源码分析》2.JLI_Launch

src/share/bin/java.c::JLI_Launch /* * Entry point. */ int JLI_Launch(int argc, char ** argv, /* main argc, argc */ int jargc, const char** jargv, /* java args */ int appclassc, const char** appclassv, /* app classp

《jdk8u源码分析》3.InitLauncher

src/windows/bin/java_md.c::InitLauncher void InitLauncher(boolean javaw) { INITCOMMONCONTROLSEX icx; /* * Required for javaw mode MessageBox output as well as for * HotSpot -XX:+ShowMessageBoxOnError in java mode, an empty * flag f

《jdk8u源码分析》5.SelectVersion

C Language Reference > Parsing C Command-Line Arguments src/share/bin/java.c::SelectVersion /* * The SelectVersion() routine ensures that an appropriate version of * the JRE is running. The specification for the appropriate version * is obtained fr

《jdk8u源码分析》5.2.JLI_ValidVersionString

src/share/bin/version_comp.c::JLI_ValidVersionString /* * Validates a version string by the extended JSR 56 grammar. */ int JLI_ValidVersionString(char *version_string) { char *vs; char *m1; char *end; if ((vers

《jdk8u源码分析》5.3.LocateJRE

src/windows/bin/java_md.c::LocateJRE /* * This is the global entry point. It examines the host for the optimal * JRE to be used by scanning a set of registry entries. This set of entries * is hardwired on Windows as "Software\JavaSoft\Java Runt

《jdk8u源码分析》5.4.ExecJRE

src/windows/bin/java_md.c::ExecJRE /* * Given a path to a jre to execute, this routine checks if this process * is indeed that jre. If not, it exec's that jre. * * We want to actually check the paths rather than just the version string * built

《jdk8u源码分析》6.CreateExecutionEnvironment

src/windows/bin/java_md.c::CreateExecutionEnvironment /* * */ void CreateExecutionEnvironment(int *pargc, char ***pargv, char *jrepath, jint so_jrepath, char *jvmpath, jint so_jvmpath,

《jdk8u源码分析》6.1.GetJREPath

src/windows/bin/java_md.c::GetJREPath /* * Find path to JRE based on .exe's location or registry settings. */ jboolean GetJREPath(char *path, jint pathsize) { char javadll[MAXPATHLEN]; struct stat s; //当前应用程序下存在jre,先加载应用程序下面的j