IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.ikvm.runtime.Launcher Class Reference

Implements the backing support for ikvm.runtime.Launcher. More...

Static Public Member Functions

static int run (Type main, string[] args, string jvmArgPrefix, global::java.util.Properties properties)
 Implements the backing support for global::ikvm.runtime.Launcher.run(Type, string[], string, global::java.util.Properties).
 

Detailed Description

Implements the backing support for ikvm.runtime.Launcher.

Definition at line 13 of file Launcher.cs.

Member Function Documentation

◆ run()

static int IKVM.Java.Externs.ikvm.runtime.Launcher.run ( Type main,
string[] args,
string jvmArgPrefix,
global.java.util.Properties properties )
static

Implements the backing support for global::ikvm.runtime.Launcher.run(Type, string[], string, global::java.util.Properties).

Parameters
main
args
jvmArgPrefix
properties
Returns

Definition at line 24 of file Launcher.cs.

25 {
26#if FIRST_PASS
27 throw new NotImplementedException();
28#else
29 if (args is null)
30 throw new ArgumentNullException(nameof(args));
31
32 // statically compiled entry points need to be explicitly added to the classpath
33 // this is sort of a hack and should be removed with a better class loader hierarchy
34 if (main != null && main.Assembly.IsDynamic == false)
35 JVM.Context.ClassLoaderFactory.GetBootstrapClassLoader().AddDelegate(JVM.Context.AssemblyClassLoaderFactory.FromAssembly(main.Assembly));
36
37 // copy properties to a CLR type
38 var p = new Dictionary<string, string>();
39 if (properties != null)
40 foreach (global::java.util.Map.Entry entry in (IEnumerable)properties.entrySet())
41 p.Add((string)entry.getKey(), (string)entry.getValue());
42
43 return IKVM.Runtime.Launcher.Run(
44 main?.Assembly,
45 ((global::java.lang.Class)main)?.getName(),
46 jar: false,
47 args,
48 jvmArgPrefix,
49 p);
50#endif
51 }
IKVM.Reflection.Assembly Assembly
Main state of the running JVM.
Utility for launching a Java class from a main entry point. Parses JVM command line options,...
Definition Launcher.cs:29
static int Run(Assembly assembly, string main, bool jar, string[] args, string rarg, IDictionary< string, string > properties)
Services as the managed entry point jump for a Java executable.
Definition Launcher.cs:263
RuntimeAssemblyClassLoader FromAssembly(Assembly assembly)
Obtains the RuntimeAssemblyClassLoader for the given Assembly. This method should not be used with dy...
RuntimeAssemblyClassLoaderFactory AssemblyClassLoaderFactory
Gets the RuntimeAssemblyClassLoaderFactory associated with this instance of the runtime.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.

The documentation for this class was generated from the following file: