views:

874

answers:

9

Can we use Java in Silverlight?

A: 

No, not as such. Microsoft isn't really fond of Java and won't let it into it's core technologies.

Joachim Sauer
+5  A: 

In short: No. Silverlight only supports .NET languages, such as Visual Basic, C#, Managed JavaScript, IronPython and IronRuby.

However, J# or IKVM.NET could be of use to you.

Ola Eldøy
You might want to add the word "only"
chakrit
It should be possible to compile any .NET Language into a Silverlight application.
justin.m.chase
+2  A: 

According to Wikipedia - Future of J#, Microsoft's own major Java support is soon to be retired.

Since J# will gets removed from the full .NET CLR itself...

I don't think there is much hope for Silverlight.

chakrit
+1  A: 

I don't quite see why you couldn't use J# in Silverlight.

Of course, you will not get your standard Java libraries since (AFAIK) they are not part of the Silverlight runtime.

EDIT:

According to http://msdn.microsoft.com/en-us/library/bb404700(VS.95).aspx :

You can create Silverlight-based applications using any .NET Framework-supported language

J# is (was?) definitely a .NET Framework-supported language. As I said, you probably will not get the .NET clones of the basic standard Java libraries (as you would get normally with the standard .NET Framework) but you can use the language itself. It's just that you won't have the java.* namespaces. (Which pretty much makes it useless.)

DrJokepu
I also would be very careful about calling J# "Java". It's not really Java and at best it's a gateway from (ancient) Java to .NET.
Joachim Sauer
+2  A: 

As others have said, No.

If you are looking for a Java equivalent to Silverlight, you may want to look into Java FX

PJ8
A: 

Interesting. The first release of Silverlight only supported javascript. Now it's not on the list.

EDIT: Excuse me for not spelling this out. In the first release, you could only program Silverlight in javascript (NOT Managed Javascript). Which made it look as if Microsoft were releasing a platform-neutral competitor to Flash and Flex. Especially directly comparable, since Actionscript (the Flex language) is a proper superset of javascript, and javascript "just works" in Flex.

Since then, the value proposition has changed. Great tools, but lockin (not a value statement, but an observation.)

Though I perhaps misunderstood, the question behind the question was whether Silverlight continues to try to appeal to platform-neutral developers, especially those using Flash and related techologies.

le dorfier
JavaScript has nothing to do with Java (appart from an unfortunate naming similarity). And from what I see JavaScript is still very much possible.
Joachim Sauer
Javascript != Java
Malfist
And "Managed Javascript" is on the list, as far as I could see.
Ola Eldøy
A: 

It may be possible with Ja.NET which compiles Java 1.5 code to .NET IL byte code. Although, as I understand it, Ja.NET is still in it's infancy so it would probably be an uphill battle.

Dave Ray
+1  A: 

I assume you can use Silverlight to talk to a .NET / Java / PHP / Ruby / Python / whatever backend through SOAP / REST / plain XML over HTTP, as you can with Adobe Flex and JavaFX.

Karsten Silz
A: 

Matters what you want but JavaFX (a framework similiar to SL) is now available. If all you want is a java-based RIA platform, that's what you want.

http://javafx.com

Shawn Wildermuth