# Friday, April 25, 2003
« Snapshot | Main | DotGNU & New Snapshot »
Stuart posted a nice comment:

Well, I now am a legitimate happy IKVM user.

I just found myself in a situation where I wanted to be able to call nrdo code (nrdo is a Java tool for database access, http://nrdo.sab39.org/) from a web application, that also had to read its input files from a windows machine. The individual parts of that aren't a problem: nrdo is reasonably well librarified so it's perfectly possible to call it from a web application, and it's perfectly possible to run Java code on windows (indeed, that's how our normal development is done).

But we don't have any windows machines running any Java application servers, and spawning a Java process from inside ASP.NET didn't appeal very much :)

It's funny how I've been following IKVM for a while but it still took ages before the obvious solution hit me. I compiled a nrdo.dll (okay, this took me longer than I thought because the -recurse option to ikvmc didn't do what I thought it would and neither did path\*.class), created an ASP.NET web application in Visual Studio, added references to classpath.dll, nrdo.dll and ik.vm.net.dll, and started typing.

It was a seriously schizophrenic experience (but in a good way!). I don't normally use an IDE for Java coding so it was the first time I'd ever seen intellisense for my nrdo libraries. And you can get seriously confused as to which language you're using when you write C# code that looks like this:

using java.util;

for (Iterator i = myList.iterator(); i.hasNext(); ) {
MyThing foo = (MyThing) i.next();

But it worked, and it took me about an hour to solve what I'd expected to be a pretty complex problem. The schizophrenic aspect is just an artefact of IKVM being really, *really* good at its job!

Thanks! Patches to make ikvmc more intuitive are always welcome of course ;-)

Friday, April 25, 2003 8:53:56 AM (W. Europe Daylight Time, UTC+02:00)  #    Comments [3] Tracked by:
"diet pills site" (diet pills site) [Trackback]
"learn to play poker online" (learn to play poker online) [Trackback]

Friday, April 25, 2003 3:37:39 PM (W. Europe Daylight Time, UTC+02:00)
Heh, well...

The main thing that would have made ikvmc more intuitive for *me* would have been if wildcards worked for filename arguments. But as far as I can tell that's a hard problem, which is presumably why they aren't supported currently.

One easy patch would be to simply look for "*" characters in filename arguments and print out an error message "Wildcards in filenames aren't supported, try making a jar file with the desired contents". As it is you get an "illegal character in pathname" (or something) exception and have to figure out for yourself that it's the * that's doing it. The workaround of making a jar file is pretty easy (since jar *does* support wildcards) but it took me a while to think of that, too, so suggesting it would perhaps be helpful.
Friday, April 25, 2003 4:59:57 PM (W. Europe Daylight Time, UTC+02:00)
Hmm, doesn't "-recurse:./*.class" do what you want?

Supporting wildcards in the filename arguments isn't that hard, but since I only use recurse, I didn't get around to implementing it.
Friday, April 25, 2003 6:45:38 PM (W. Europe Daylight Time, UTC+02:00)
Hmm, recurse didn't do what I wanted at all and I thought I must have been misinterpreting its purpose.

Ah, I think I see: I was expecting to just be able to do "-recurse:classes" (where classes is a folder). I didn't expect to have to say "-recurse:classes\*.class" because to my (unix-centric) mind, classes\*.class explicitly means things called *.class in the classes directory and NOT subdirectories.

If "-recurse" worked without the "*.class" part of its argument it would make more sense to me.

I'd also still like wildcards to work in general, because in my particular case I wanted to include only a subset of the classes in a particular directory, so I wanted net\netreach\nrdo\tools\*Def*.class and net\netreach\nrdo\tools\Gen*.class and so on. I'm not sure whether the current behavior of recurse would cover that (because I don't quite understand what the current behavior is), but it seems unintuitive to have to use -recurse when I'm not actually recursing, just matching a particular subset of files in a directory.
Home page

I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.

Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)

Comment (HTML not allowed)  

Live Comment Preview