EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Shall I move from C to Java?

Started by dick August 14, 2007
[X-post lacked F'up2, reduced to one group]

dick wrote:

> If I design a HW platform, how can I run Java in this bare machine.
I'll be blunt. If you must ask, you can't.
dick wrote:
> Hi everyone, > > I am planning to learn Java. > > Can I access HW registers in Java? Or can I call C function from Java > program?
Read up on this, http://www.maxim-ic.com/products/microcontrollers/tini/ "The platform is a combination of the broad-based I/0, a full TCP/IP stack, and an extensible Java runtime environment that simplifies development of the network connected equipment" and also this http://www.parallax.com/javelin/index.asp and this is not Java, but could be more interesting : http://www.parallax.com/propeller/index.asp a code example is here http://obex.parallax.com/objects/30/ -jg
dick wrote:
> Can I access HW registers in Java?
Not directly.
> Or can I call C function from Java > program?
My java is *way* rusty but ... you might take a look at the "javah" tool, which is used to generate C/C++ header files and stubs based on a java class file. -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." "Already Gone" by Jack Tempchin (recorded by The Eagles) The Beatles were wrong: 1 & 1 & 1 is 1
dick wrote:
> Tim Wescott wrote: >> On Mon, 13 Aug 2007 22:07:16 -0700, dick wrote: >> >>> Hi everyone, >>> >>> I am planning to learn Java. >>> >>> Can I access HW registers in Java? Or can I call C function from Java >>> program? >>> >>> Thanks. >> Even though I don't know much about Java, I know these tidbits: >> >> No, you cannot directly access hardware from Java. I would be surprised >> to find a serious Java for embedded use that did not include library >> functions to do so, however. >> >> Java itself doesn't provide a means to call C functions, but most Java run >> time environments provide a means to call external code. Of course, if >> you're calling external code then you have to maintain code bases in C >> _and_ Java... > > If I design a HW platform, how can I run Java in this bare machine. >
[Please don't quote signature blocks. I've correct this here.] This is, of course, getting way off-topic for comp.lang.c. I'm sure there is an "embedded Java" newsgroup out there, and Google returns a sick amount of hits for that phrase. However, it may be instructive to consider that implementing embedded systems does not have to be all bare-metal bit-banging. There is a relatively long tradition of interpreted byte-code slinging in the embedded world. It really depends on your application and deployment. -- clvrmnky <mailto:spamtrap@clevermonkey.org> Direct replies will be blacklisted. Replace "spamtrap" with my name to contact me directly.
Hans-Bernhard Br=F6ker wrote:
> [X-post lacked a F'up2; reduced to one group] > > dick wrote: > > > I am planning to learn Java. > > Why, given you clearly don't know if it's going to do you any good? > > > Can I access HW registers in Java? Or can I call C function from Java > > program? > > If you must ask, that strongly implies it's a bad idea for you to learn > Java at this point. You have to analyze what it means to use Java > instead of C first.
Is there any C syntax extension that support multi-thread like Java syntax? or how can I use C Macro to hide the OS routine call in C program? I don't like the style: fun(...) { p(); . . . v(); } I want to use syn fun(...) { . . . } another question is how to disable "goto", can I write #define goto error("no goto")
dick wrote:
> Hans-Bernhard Br&#4294967295;ker wrote: >> [X-post lacked a F'up2; reduced to one group]
>> dick wrote:
> Is there any C syntax extension that support multi-thread like Java > syntax?
No.
> or how can I use C Macro to hide the OS routine call in C program?
What makes you think you need to do that, or that OS routine calls would even exist in an embedded systems?

dick wrote:
> Hi everyone, > > I am planning to learn Java. > > Can I access HW registers in Java? Or can I call C function from Java > program? > > Thanks.
http://www.microsoft.com/mspress/books/10457.aspx Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Tue, 14 Aug 2007 20:15:12 +0000, Vladimir Vassilevsky wrote:

> > > dick wrote: >> Hi everyone, >> >> I am planning to learn Java. >> >> Can I access HW registers in Java? Or can I call C function from Java >> program? >> >> Thanks. > > > http://www.microsoft.com/mspress/books/10457.aspx
It appears to have nothing to do with C <ot>nor with Java</ot>. -- Army1987 (Replace "NOSPAM" with "email") No-one ever won a game by resigning. -- S. Tartakower
On Aug 13, 10:07 pm, dick <dick_12345...@hotmail.com> wrote:
> Hi everyone, > > I am planning to learn Java.
http://www.cafeaulait.org/javafaq.html followed by news:comp.lang.java
> Can I access HW registers in Java?
No.
> Or can I call C function from Java > program?
Do a web search for "JNI java". It's a bloody pain in the posterior. As far as I can see, you have no C questions whatsoever in your post. Probably, Java questions go better in a Java group.
On Aug 14, 4:15 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> dick wrote: > > Hi everyone, > > > I am planning to learn Java. > > http://www.microsoft.com/mspress/books/10457.aspx
What has Microsoft's proprietary closed nonsense got to do with Java? Or, for that matter, embedded programming?

Memfault Beyond the Launch