Closed sergey-tihon closed 1 year ago
Need to specify all of the -reference items that would make up the BCL of the desired target framework set. Specifically in this case, it can't find the 'core library', which will be mscorlib.dll for Framework.
For instance, if you want to link to the targeting pack for .NET 4.8, on Windows x64, you'd find the mscorlib.dll assembly in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8
, and the other assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades
, and add them as -reference items to the command.
Though they can be installed elsewhere. And you might not want to link to reference assemblies. For instance, if you intend to link to the Microsoft.NETFramework.ReferenceAssemblies NuGet package, you would need to specify the assemblies from that. Up to you.
Hmm... got it, thank you.
@wasabii is there an replacement for ikvm.@internal.ClassLiteral<T>.Value
?
IKVM.Runtime.ClassLiteral, though it isn't intended to be used outside of IKVM.
What's going on here?
There are plenty of API inside Stanford CoreNLP that get Class
as a parameter and use it as a key to look up some metadata.
ikvm.@internal.ClassLiteral<T>.Value
was a nice hack to get Class
from Type
and they use it for lookup.
java.lang.Class can be cast to System.Type
Here I need another way around, System.Type
-> java.lang.Class
You can cast System.Type to java.lang.Class.
The operation is different though, but probably compatible for your situation.
ClassLiteral
For instance, (Class)typeof(object)
actually results in the Class for java.lang.Object. And (Class)typeof(java.lang.Object)
results in the Class for System.Object. And the cast operator handles arrays, ghost interfaces, etc. And it will return null
for impossible operations, such as casting a pointer type to a Class, managed reference, or generics, since those have no Java representation.
Think of the cast operator as answering this question: "if I were to have a .NET type T, and I wanted to pass it to a Java method, in Java, what would the Class of that parameter be?"
Something changed in IKVMc usage (or I just did it wrong). Appreciate any suggestions
I am migrating the build to the newer version of IKVM and run it on
Windows 11 23H2 22631.2506
IKVM-8.2.1-tools-ikvmc-net461.zip
IKVM-8.7.1-tools-net472-win-x64.zip
IKVM-8.2.1-bin-net461.zip
IKVM-8.7.1-tools-net472-win-x64.zip
Where I till
ikvmc
:I see the null reference error: