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

香港 1核1G 29元/月 美国1核 2G 36元/月 快云科技

快云科技: 11.11钜惠 美国云机2H5G年付148仅有40台,云服务器全场7折,香港云服务器年付388仅不到五折 公司介绍:快云科技是成立于2020年的新进主机商,持有IDC/ICP/ISP等证件资质齐全主营产品有:香港弹性云服务器,美国vps和日本vps,香港物理机,国内高防物理机以及美国日本高防物理机官网地址:www.345idc.com活动截止日期为2021年11月13日此次促销活动提供...

wordpress外贸企业主题 wordpress经典外贸企业建站主题

WordPress经典外贸企业建站主题,经典配色扁平化简约设计+跨屏自适应移动端设备,特色外贸企业建站功能模块+在线Inquiry询单功能,更有利于Google等英文搜索优化和站点收录。采用标准的HTML5+CSS3语言开发,兼容当下的各种主流浏览器: IE 6+(以及类似360、遨游等基于IE内核的)、Firefox、Google Chrome、Safari、Opera等;同时支持移动终端的常用...

Fiberia.io:$2.9/月KVM-4GB/50GB/2TB/荷兰机房

Fiberia.io是个新站,跟ViridWeb.com同一家公司的,主要提供基于KVM架构的VPS主机,数据中心在荷兰Dronten。商家的主机价格不算贵,比如4GB内存套餐每月2.9美元起,采用SSD硬盘,1Gbps网络端口,提供IPv4+IPv6,支持PayPal付款,有7天退款承诺,感兴趣的可以试一试,年付有优惠但建议月付为宜。下面列出几款主机配置信息。CPU:1core内存:4GB硬盘:...

cn163.net为你推荐
1f20;BACKGROUND-COLOR:#4ae2f7">16-bit支持ipadxp如何关闭445端口Windows XP 怎么关闭445端口,我是电脑小白,求各位讲详细点ipad连不上wifiiPad 连不上Wifi,显示无互联网连接windows键是哪个Windows键是哪个键啊?iphone连不上wifi我的苹果手机连不上无线,其它手机能,怎么回事?只是家里的连不上itunes备份itunes 里面的资料如何备份?重庆电信宽带管家电信的宽带上网助手是什么?csshack关于CSS hack的写法firefoxflash插件Firefox浏览器怎么激活adobe flash插件
虚拟主机服务商 论坛虚拟主机 fc2最新域名 域名备案网站 万网域名管理 国内免备案主机 inmotionhosting 抢票工具 godaddy优惠券 typecho 最好看的qq空间 丹弗 vip购优汇 可外链网盘 太原网通测速平台 如何注册阿里云邮箱 工信部网站备案查询 登陆qq空间 asp空间 rewritecond 更多