Replies: 2 comments
-
Launcher isn't meant to be used directly. That is the method that is set as the main entry point for executables such as java.exe, javac.exe, etc. If you want to call into other code, such as Spring, you need to call directly the appropriate methods that those other libraries say you should call. |
Beta Was this translation helpful? Give feedback.
-
I think the general way to use Java code through IKVM in C# (or other supported .NET language) code is to use Java functions directly, as in the answer above, using JNI in C/C++. If IkvmReference is set correctly, you can use functions in Java code linked with IkvmReference as if they were functions in .NET assembly, easier than JNI. IKVM.Runtime.Launcher is responsible for finding and executing Java main in .NET code, as in the answer above. If you want to know the parameters, I will list the information I found while testing various things. string main : Java class name including full package name where Java main function is located. bool jar : It seems to specify whether or not there is a jar file. string [] args : Pass the string [] args of the main function that you want to use the launcher. string rarg : I don't know what it is, but it seems to be used in the format of "-J". IDictionary<string, string>properties : Pass the Java -D options to an object of type IDictionary<string, string> (null if none) As of now, one more parameter has been added, and the following parameter is entered before string main... Assembly ssembly : The .NET assembly for the class that has the main function among the classes in the converted jar files (use in the format of typeof ([assembly name including namespace]).Assembly. If it is long, you can specify the namespace part as using and enter only the assembly name.)
Exception in thread "Thread-0" java.lang.IllegalStateException: java.lang.NullPointerException It seems that it cannot be used with IKVM because it throws an error like this |
Beta Was this translation helpful? Give feedback.
-
I want to start a springboot program through IKVM in the code, and I found a method that seems to achieve this goal,
IKVM.Runtime.Launcher.Run (string main, bool jar, string [] args, string rarg, IDictionary<string, string>properties),
but I am not sure what each parameter represents and their format. I did not find any relevant content in the project documentation. Can anyone give me a demo in parameter format? Or is there any other method that can be implemented in the code? thank you very much indeed
Beta Was this translation helpful? Give feedback.
All reactions