|
You can use IKVM to access your boo assemblies from java or access java classes from boo. |
This example shows how to run booish from java:
http://blogs.codehaus.org/people/bamboo/archives/000887_booish_meets_java.html
This uses IKVM's IKVM.GNU.CLASSPATH.dll which wraps java's standard libraries:
//testjavavector.boo
import java.util from "IKVM.GNU.CLASSPATH" //or reference the dll
v = Vector()
v.add("Hello")
print v
|
This AWT example still needs some work. I don't think Java's Swing will work with IKVM though. However, there is an open source clone of Swing called SwingWT that will work with IKVM.
//testawt.boo (needs work)
import java.awt from "IKVM.GNU.CLASSPATH"
class Hello(Frame):
def constructor():
hello = Label("Hello World")
add(hello,"Center")
setSize(200,200)
setVisible(true)
h = Hello()
|
If you have a copy of Visual Studio .NET 2003 or 2005, you can install and run the JLCA tool from Microsoft to convert java code to C# code. This will even do things like convert "getWidth/setWidth" methods into properties, and convert java swing stuff into windows.forms code. It generates a report listing any specific issues it had with the conversion, as well as including the same notes as comments in the generated files.
You can then use the online code converter tool used by SharpDevelop to convert the generated C# code into boo code. Comments are preserved throughout both the JLCA and SharpDevelop conversions.
This may be a better option than IKVM for example if the java app uses java swing (which IKVM cannot run), or if you want to convert the source so that the application can be optimized for the .NET/Mono platform.