Exposingcn163

cn163.net  时间:2021-03-02  阅读:()
IKVM.
NETBuildingaJavaVMonthe.
NETFrameworkJeroenFrijtersWhoamIJeroenFrijters/YeroonFrighters/Co-founderofasmallISVinTheNetherlandsLeaddeveloperofIKVM.
NETanOpenSourceJVMfor.
NETWhatisIKVM.
NETJavaVMontopof.
NET&Mono–JITcompilertotranslateJavabytecodeintoMSIL–Reflection–Etc.
StaticcompilerthattranslatesJavaclasses/jarsinto.
NETassemblies–BasicallyaheadoftimecompilerforabovementionedJIT.
NETportofOpenJDKclasslibrary–Somegaps,butmostAPIspartof"Java"areavailableWhyisIKVM.
NETStartedinthespringof2002asanexperimentMyblogonJune19th,2002:"IhavealargeJavaapplicationthatIwouldliketoslowlymigrateto.
NET,inordertobeabletodothat,IneedawaytointeroperatewithJavacode,theexistingsolutionsIhavelookedatareinadequate.
Besides,It'slotsoffuntobuildsomethinglikethis:-)"CompatibilityJava7–BasedOpenJDKclasslibrarywithoutthenativecode.
–Swing/AWT/Fonts/Graphics/Printingnotsupported.
TherearesomeminorVMlevelincompatibilities,butsofarthesearejusttheoretical.
Practicalsourcesofincompatibilities:–sun.
*packages–"Theclassloaderproblem"[System|IKVM].
ReflectionThankstoAppDomain.
TypeResolveeventitispossibletobuildamanaged"JIT".
But,System.
Reflectionhassomeseriouslimitationsforcompilers.
IKVM.
Reflectionisnowusedbyikvmc,MonoC#compiler,Scala.
NETandothers.
TypeSystemcli.
System.
Objectextendsjava.
lang.
Objectjava.
lang.
Object:System.
Objectjava.
lang.
Stringisonlyacontainerforstaticmethods.
InstancesarealwaysSystem.
String.
cli.
System.
Exceptionsextendsjava.
lang.
Throwablejava.
lang.
Throwable:System.
Exception(checkedexceptions)TypeSystemcont.
java.
lang.
Comparable:System.
IComparablejava.
lang.
Cloneable,java.
io.
Serializable&java.
lang.
CharSequenceneedtobespecialcased(stringsandarrays)Exposing.
NETfeaturestoJavaDelegatesByRefmethodargumentsCustomattributesValueTypesEnumsProperties&EventsDelegatesinJavapublicfinalclassRunnableDelegateextendscli.
System.
MulticastDelegateimplementsRunnable{publicRunnableDelegate(Methodm){}publicnativevoidInvoke();publicinterfaceMethod{voidInvoke();}publicvoidrun(){Invoke();}}DelegatesinJavapackageikvm.
runtime;publicfinalclassDelegates{publicstaticRunnabletoRunnable(RunnableDelegatedelegate){returndelegate;}}java.
lang.
Threadthread=newjava.
lang.
Thread(ikvm.
runtime.
Delegates.
toRunnable(delegate{Console.
WriteLine("HelloWorld");}));thread.
start();ByRefMethodArgumentsSameasinJava,hackitwithanarrayWouldliketousegenerics,buterasuremakesthishard(duetoinabilitytodomethodoverloading)CustomAttributesExposingthemasannotationsworks(mostofthetime)packagesun.
misc;classUnsafe{@SecurityPermissionAttribute.
Annotation(value=SecurityAction.
__Enum.
LinkDemand,UnmanagedCode=true)@cli.
System.
Security.
SecurityCriticalAttribute.
AnnotationpublicvoidfreeMemory(longaddress){Marshal.
FreeHGlobal(IntPtr.
op_Explicit(address));}}ValueTypesWeaksupport:–YoucanonlyusethemfromJava,notdefinethem.
–Willusuallybeboxed.
EnumsWouldliketheabilitytodomethodoverloadingbasedonenumtypeNeedabilityto"bittwiddle"Usableincustomattributeannotationspackagecli.
System;publicfinalclassDayOfWeekextendscli.
System.
Enum{publicstaticfinalintSunday=0;publicstaticfinalintMonday=1;…publicfinalintValue;publicstaticnativeDayOfWeekwrap(inti);}Properties&EventsNospecialsupportDirectlyusetheunderlyingmethodsimportcli.
System.
Windows.
Forms.
*;classDemo{publicstaticvoidmain(String[]args){Formform=newForm();form.
set_Width(400);form.
set_Height(400);form.
add_FormClosing(newFormClosingEventHandler(newFormClosingEventHandler.
Method(){publicvoidInvoke(Objectsender,FormClosingEventArgsargs){System.
out.
println("Closing.
.
.
");}}));Application.
Run(form);}}ExposingJavato.
NETKeepingIntelliSensecleanStaticfieldsininterfacesAnnotationsGenericsWorkaroundsExposingJavato.
NETKeepingIntelliSensecleanStaticfieldsininterfacesAnnotationsGenericsWorkarounds__WorkaroundBaseClass__publicabstractclassBase{protectedabstractvoidM();}publicabstractclassDerived:Base{publicoverridevoidM(){}}classProgram:Derived{}errorCS0534:'Program'doesnotimplementinheritedabstractmember'Base.
M()'publicabstractclassBase{protectedabstractvoidM();}[HideFromJava][EditorBrowsable(EditorBrowsableState.
Never)]publicabstract__WorkaroundBaseClass__Derived:Base{protectedoverridevoidM(){thrownewAbstractMethodError();}}publicabstractclassDerived:__WorkaroundBaseClass__Derived{publicoverridevoidM(){}}__WorkaroundBaseClass__classProgram:Derived{}Interop"Magic"Limitedsupportforautomagic.
NETserializationsupportforJavaserializableclasses.
NETexceptionsareserializedascom.
sun.
xml.
internal.
ws.
developer.
ServerSideExceptionjava.
io.
Closeable=>System.
IDisposablejava.
lang.
Iterable=>System.
IEnumerablejava.
lang.
AutoCloseableSystem.
IDisposable"JarHell"HardtodeterminejardependenciesCirculardepenciesoccurmoreoftenthanyou'dthinkikvmc{foo.
jar-out:Foo.
dll}{bar.
jar-out:Bar.
dll}PerformanceTypicallyprettygood.
NEToftenwinsonstringprocessingExceptionheavycodesuffersDon't"benchmark"underthedebugger!
UsersSeveralcommercialandopensourceapplicationsuseIKVM.
NET"AtmycompanywearestillamazedtoseelargepartofourJavasystemsuccessfullyrunningon.
NETplatformthankstoIKVM.
"AndyMalakov,DeltixLab,Inc.
"WeareveryhappywithIKVM.
ItenablesustodevelopourcorelibrariesinJavaandcompileforusein.
NET.
TheIKVMteamisveryresponsiveandknowledgeableabouttheissueswewerefacing.
"ShamusNeville,eTradingandAnalyticsGroupatHSBC"HavingusedIKVMforoverayear,wehavefoundIKVMtoworkreliablyandofferproductionqualityoperation.
Theonetimewherewedidrunintosomespecificproblem,theopensourcenatureofIKVMallowedustoquicklytrackdownthebugandverifythecauseoftheproblem.
Wehadafixfortheproblemtheverysameday.
"OttoPerdeck,ChordiantSoftwareMoreathttp://www.
ikvm.
net/stories.
htmlQuestionsMoreInformationProjectWebsite:http://www.
ikvm.
net/jeroen@frijters.
nethttp://weblog.
ikvm.
net/@JeroenFrijters

BuyVM($5/月),1Gbps不限流量流媒体VPS主机

BuyVM针对中国客户推出了China Special - STREAM RYZEN VPS主机,带Streaming Optimized IP,帮你解锁多平台流媒体,适用于对于海外流媒体有需求的客户,主机开设在拉斯维加斯机房,AMD Ryzen+NVMe磁盘,支持Linux或者Windows操作系统,IPv4+IPv6,1Gbps不限流量,最低月付5加元起,比美元更低一些,现在汇率1加元=0.7...

Virmach($7.2/年)特价机器发放

在八月份的时候有分享到 Virmach 暑期的促销活动有低至年付12美元的便宜VPS主机,这不开学季商家又发布五款年付VPS主机方案,而且是有可以选择七个数据中心。如果我们有需要低价年付便宜VPS主机的可以选择,且最低年付7.2美元(这款目前已经缺货)。这里需要注意的,这次发布的几款便宜年付方案,会在2021年9月30日或者2022年4月39日,分两个时间段会将INTEL CPU迁移至AMD CP...

日本CN2独立物理服务器 E3 1230 16G 20M 500元/月 提速啦

提速啦的来历提速啦是 网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑 由赣州王成璟网络科技有限公司旗下赣州提速啦网络科技有限公司运营 投资1000万人民币 在美国Cera 香港CTG 香港Cera 国内 杭州 宿迁 浙江 赣州 南昌 大连 辽宁 扬州 等地区建立数据中心 正规持有IDC ISP CDN 云牌照 公司。公司购买产品支持3天内退款 超过3天步退款政策。提速啦的市场定位提速啦主...

cn163.net为你推荐
搜狗输入法安利定制版问与答万家增强收益债券型证券投资基金支持ipad重庆宽带测速重庆哪一种宽带网速最快ipad连不上wifiipad2 wifi连接不上,刚连上就弹出一个 success页面勒索病毒win7补丁win7有针对勒索病毒的补丁吗重庆电信网速测试如何测量网速canvas2Canvas ~セピア色のモチーフ~ 这个动画片的中文翻译是什么?从哪看?谷歌sb为什么百度一搜SB是谷歌,谷歌一搜SB是百度?win7关闭135端口win7系统怎么关闭135端口?网上很多方法都不好用!
花生壳动态域名 .cn域名注册 金万维动态域名 新秒杀 东莞电信局 私服服务器 debian6 网通服务器ip 国外网站代理服务器 重庆双线服务器托管 空间首页登陆 广州服务器托管 学生机 windowsserver2012r2 时间服务器 建站论坛 windowsserver2012 ubuntu安装教程 傲盾代理 德国代理ip 更多