Re: [Ikvm-developers] Problems using ToolProvider.getSystemJavaCompiler in IKVM converted Assembly
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2013-03-13 14:15:58
|
Hi Martin, The simple answer is that IKVM tries to be a JRE, not JDK. C:\j>\jdk1.7.0_13\bin\java Main Java compiler found!!! Hooraaay!!! C:\j>\jre7u17\bin\java Main Java compiler not found! Having said that, the javac code is present in IKVM.OpenJDK.Tools.dll so it probably not be too hard to somehow convice getSystemJavaCompiler to return a compiler. One "problem" would be that it would be pretty slow, because javac reads the Java library classes from boot classpath, which is emulated on IKVM by the Virtual File System and these stub classes are generated on demand. Regards, Jeroen > -----Original Message----- > From: spama [mailto:mar...@si...] > Sent: Wednesday, March 13, 2013 14:56 > To: ikv...@li... > Subject: [Ikvm-developers] Problems using > ToolProvider.getSystemJavaCompiler in IKVM converted Assembly > > > Hi everyone, > > I have a problem with my application that uses the java compiler to > compile java source files to class files. > > I try to describe the problem in detail: > > I have a java module (modul_a.jar). Inside this module i'm using the > java > compiler: > > JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); > ... do some stuff ... > > The JavaCompiler is returned and everything works perfect. > > I convert this module to modul_a.dll using the ikvmc. When i run my > modul everything works fine but the call to > ToolProvider.getSystemJavaCompiler(); returns <null>. > > I've tried many things to fix the problem, but couldn't get it working. > > I searched the whole web for a solution of our problems and so far found > the following informations, that unfortunatly didn't help me to solve > the > problem: > http://old.nabble.com/Get-NULL-when-call- > ToolProvider.getSystemJavaCompiler()-td31891806.html > http://old.nabble.com/Get-NULL-when-call- > ToolProvider.getSystemJavaCompiler()-td31891806.html > http://weblog.ikvm.net/PermaLink.aspx?guid=ac6cfb6a-6138-4c36-895e- > 636c77242e39 > http://weblog.ikvm.net/PermaLink.aspx?guid=ac6cfb6a-6138-4c36-895e- > 636c77242e39 > http://weblog.ikvm.net/CommentView.aspx?guid=e52cb250-33b1-4d51-bb2e- > 8fa5c9e41e53 > http://weblog.ikvm.net/CommentView.aspx?guid=e52cb250-33b1-4d51-bb2e- > 8fa5c9e41e53 > http://sourceforge.net/tracker/index.php?func=detail&aid=2895155&group_i > d=69637&atid=525264 > http://sourceforge.net/tracker/index.php?func=detail&aid=2895155&group_i > d=69637&atid=525264 > > To narrow it down i wrote a small test application: > > import javax.tools.JavaCompiler; > import javax.tools.ToolProvider; > > public class Main { > > public static void main(String[] args) { > JavaCompiler c = ToolProvider.getSystemJavaCompiler(); > if(c == null) > { > System.out.println("Java compiler not found!"); > } > else > { > System.out.println("Java compiler found!!! Hooraaay!!!"); > } > } > } > > for java the output is "Java compiler found!!! Hooraaay!!!" , for .NET > it is "Java compiler not found!". > > I converted to ikvm using the following ikvmc calls: > - ikvmc.exe -out:javatest.exe -target:exe -sharedclassloader > JavaTestModule.jar > - ikvmc.exe -out:javatest.exe -target:exe -sharedclassloader - > classloader:ikvm.runtime.ClassPathAssemblyClassLoader JavaTestModule.jar > -ikvmc.exe -out:javatest.exe -target:exe - > classloader:ikvm.runtime.ClassPathAssemblyClassLoader JavaTestModule.jar > > alsways the same result -> "Java compiler not found!". > > Can anyone help me with this problem? > > Thanks in advance! > > Martin > -- > View this message in context: http://old.nabble.com/Problems-using- > ToolProvider.getSystemJavaCompiler-in-IKVM-converted-Assembly- > tp35169709p35169709.html > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------ > ------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > _______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers |