February 21st, 2010
IKVM - Java로 .NET 애플리케이션 만들기

IKVM은 멋지구리다.
.NET세상과 Java세상의 접목에 대한 상상을 대부분 처리해 준다.
한 문장으로 '.NET으로 구현한 JVM' 이라고 하지만 실상은 그 보다 기특하더군.
다음 3가지 툴이 핵심이다.

  1. ikvm : JVM on .NET (dynamic mode)
  2. ikvmc : *.class / *.jar -> *.DLL or *.EXE(.NET assembly) converter
  3. ikvmstub : Generate *.JAR(bodyless stub classes) from .DLL(.NET assembly)

간단히 설명하면,
1)은 사용자입장에서는 Sun이외의 다른회사의 JVM이다. 기존에 'java -jar HelloWorld.jar'를 'ikvm -jar HelloWorld.jar'로 바꿔사용 하면 된다. VM이 .NET으로 구현되었다고 하지만 어짜라구? 어찌됬던 runtime에 java bytecode -> .NET CIL 로 변환하기 때문에 좀 느리단다.

2)는 1)보다 재미있다. 일반 .NET application 처럼 .exe 혹은 .dll을 만들어 준다. 즉, 'java -jar HelloWorkd.jar'가 아니라 'HelloWorld.exe'가 된다. first class .NET assembly이기 때문에 1)보다 실행도 빠르다. 다음 간단한 예제를 적용해 보았다.

JAVA:
  1. <br />
  2. package net.hanjava.dotnet;</p>
  3. <p>public class HelloProperties {<br />
  4.     public static void main(String... args) {<br />
  5.         System.getProperties().list(System.out);<br />
  6.     }<br />
  7. }<br />

ikvmc -target:exe -main:net.hanjava.dotnet.HelloProperties bin\net\hanjava\dotnet\HelloProperties.class 하고 실행하면

이런... deployment always sucks!!
가장 심오한 해결책으로 IKVM 디렉토리로 HelloProperties.exe를 옮기고 실행..

JAVA:
  1. <br />
  2. -- listing properties --<br />
  3. java.runtime.name=IKVM.NET<br />
  4. sun.boot.library.path=C:\.virtual-ikvm-home\bin<br />
  5. java.vm.version=0.40.0.1<br />
  6. java.vm.vendor=Jeroen Frijters<br />
  7. java.vendor.url=http://ikvm.net/<br />
  8. path.separator=;<br />
  9. java.vm.name=IKVM.NET<br />
  10. file.encoding.pkg=sun.io<br />
  11. user.country=KR<br />
  12. sun.os.patch.level=<br />
  13. java.vm.specification.name=Java Virtual Machine Specification<br />
  14. user.dir=C:\IKVM<br />
  15. java.runtime.version=0.40.0.1<br />
  16. os.arch=x86<br />
  17. java.io.tmpdir=C:\Documents and Settings\behumble\Lo...<br />
  18. line.separator=</p>
  19. <p>java.vm.specification.vendor=Sun Microsystems Inc.<br />
  20. user.variant=<br />
  21. os.name=Windows XP<br />
  22. gnu.classpath.version=0.95<br />
  23. java.library.path=C:\IKVM;.;C:\WINDOWS\Sun\Java\bin;C:\...<br />
  24. java.specification.name=Java Platform API Specification<br />
  25. java.class.version=50.0<br />
  26. os.version=5.1<br />
  27. user.home=C:\Documents and Settings\behumble<br />
  28. user.timezone=<br />
  29. gnu.javax.swing.noGraphics2D=true<br />
  30. file.encoding=ks_c_5601-1987<br />
  31. java.specification.version=1.6<br />
  32. user.name=behumble<br />
  33. java.class.path=<br />
  34. java.vm.specification.version=1.0<br />
  35. sun.arch.data.model=32<br />
  36. java.home=C:\.virtual-ikvm-home<br />
  37. java.specification.vendor=Sun Microsystems Inc.<br />
  38. user.language=ko<br />
  39. openjdk.version=OpenJDK 6 b12<br />
  40. awt.toolkit=ikvm.awt.NetToolkit, IKVM.AWT.WinForm...<br />
  41. java.vm.info=compiled mode<br />
  42. sun.nio.MaxDirectMemorySize=-1<br />
  43. java.version=1.6.0<br />
  44. java.ext.dirs=<br />
  45. java.vendor=Jeroen Frijters<br />
  46. file.separator=\<br />
  47. java.vendor.url.bug=http://www.ikvm.net/bugs<br />
  48. sun.cpu.endian=little<br />

3) ikvmstub mscorlib.dll 하면 mscorlib.jar를 생성해 준다. 이제 자바 코드로 .NET library를 호출할 수 있다.
당연한 이야기지만 stub만 생성된다. CIL을 해석해서 bytecode로 변경해주는 일 따위는 안한다.

막상 중요한 .NET과 Java의 interop은 상상의 날개를 펼치면 된다.

그런데 이런 짓은 왜 하지?

September 19th, 2009
svg2emf included in the Softpedia Mac OS software database

아무도 안 보는줄 알았는데 신기할 따름...

Congratulations,

svg2emf, one of your products, has been added to Softpedia's database of
software programs for Mac OS. It is featured with a description text,
screenshots, download links and technical details on this page:
http://mac.softpedia.com/get/Graphics/svg2emf.shtml

The description text was created by our editors, using sources such as
text from your product's homepage, information from its help system, the
PAD file (if available) and the editor's own opinions on the program
itself.

"svg2emf" has been tested in the Softpedia labs using several
industry-leading security solutions and found to be completely clean of
adware/spyware components. We are impressed with the quality of your
product and encourage you to keep these high standards in the future.

To assure our visitors that svg2emf is clean, we have granted it with the
"100% FREE" Softpedia award. To let your users know about this
certification, you may display this award on your website, on software
boxes or inside your product.

More information about your product's certification and the award is
available on this page:
http://mac.softpedia.com/progClean/svg2emf-Clean-63256.html

Feel free to link to us using the URLs above. If you choose to link to the
clean award page for your product, you may use the award graphic or a text
link: "100% FREE award granted by Softpedia".