Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Discussion Groups

Discussion Groups | Comp.Arch.Embedded | Shall I move from C to Java?

There are 35 messages in this thread.

You are currently looking at messages 0 to 10.

Shall I move from C to Java? - dick - 01:07 14-08-07



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.


Re: Shall I move from C to Java? - Tim Wescott - 01:10 14-08-07

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...

-- 
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Re: Shall I move from C to Java? - dick - 01:26 14-08-07

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...
>
> --
> Tim Wescott
> Control systems and communications consulting
> http://www.wescottdesign.com
>
> Need to learn how to apply control theory in your embedded system?
> "Applied Control Theory for Embedded Systems" by Tim Wescott
> Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html






If I design a HW platform, how can I run Java in this bare machine.


Re: Shall I move from C to Java? - Keith Thompson - 02:28 14-08-07

dick <d...@hotmail.com> writes:
[...]
> If I design a HW platform, how can I run Java in this bare machine.

Your first step should be to find a newsgroup with "java" in its name.

-- 
Keith Thompson (The_Other_Keith) k...@mib.org  <http://www.ghoti.net/~kst>;
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>;
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Re: Shall I move from C to Java? - Sheth Raxit - 02:36 14-08-07

On Aug 14, 9:26 am, dick <dick_12345...@hotmail.com> 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...
>
> > --
> > Tim Wescott
> > Control systems and communications consulting
> >http://www.wescottdesign.com
>
> > Need to learn how to apply control theory in your embedded system?
> > "Applied Control Theory for Embedded Systems" by Tim Wescott
> > Elsevier/Newnes,http://www.wescottdesign.com/actfes/actfes.html
>
> If I design a HW platform, how can I run Java in this bare machine.- Hide quoted text -
As per my basic understanding, for your hardware platform you need to
Develop or Port Java Run Time Environment <JVM , regret i am not java
guru and This is not Java-news group, regret if you think replying to
OT>

-Raxit
>
> - Show quoted text -



Re: Shall I move from C to Java? - Tim Wescott - 02:48 14-08-07

On Mon, 13 Aug 2007 22:26:54 -0700, 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...
>>
>> --
>> Tim Wescott
>> Control systems and communications consulting
>> http://www.wescottdesign.com
>>
>> Need to learn how to apply control theory in your embedded system?
>> "Applied Control Theory for Embedded Systems" by Tim Wescott
>> Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
> 
> 
> 
> 
> 
> 
> If I design a HW platform, how can I run Java in this bare machine.

You need a Java run-time environment to run Java, at which point the
machine would no longer (by my definition) be "bare".

-- 
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Re: Shall I move from C to Java? - Bob - 03:09 14-08-07

On Aug 13, 10:26 pm, dick <dick_12345...@hotmail.com> wrote:
>
> If I design a HW platform, how can I run Java in this bare machine

A typical embedded system will not have the CPU
power or memory to interpret the bytecode at
runtime, so that leaves two options:

1.  Use a compiler that generates native machine
    code.  See http://gcc.gnu.org/java/

2.  Use a uC that includes hardware support for
    Java bytecodes.  There are several inexpensive
    (less than $10) microcontrollers based on the
    ARM926EJ-S core, including Atmel's AT91SAM9260
    and NXP's LPC3180.

My opinion is that Java is a poor language
choice for most embedded system projects.  But
you can come to you own conclusion about that.

[comp.lang.c removed from newsgroups]


Re: Shall I move from C to Java? - Ivar Rosquist - 04:36 14-08-07

On Mon, 13 Aug 2007 22:07:16 -0700, dick wrote:

> Hi everyone,
> 
> I am planning to learn Java.

	So you can compile programs once in one platform, and run them 
nowhere?

> Can I access HW registers in Java? 

	I bet you can't.

> Or can I call C function from Java program?

	Yes - using JNI. The catch is that the overhead introduce by this 
is such that in most cases the resulting code is almost as slow as an all 
Java code.



Re: Shall I move from C to Java? - Chris Dollin - 05:20 14-08-07

Ivar Rosquist wrote:

> On Mon, 13 Aug 2007 22:07:16 -0700, dick wrote:
> 
>> Hi everyone,
>> 
>> I am planning to learn Java.
> 
>       So you can compile programs once in one platform, and run them 
> nowhere?

Don't be (a) silly (b) atopical.
 
>> Can I access HW registers in Java? 
> 
>       I bet you can't.

You can't in C, either.

>> Or can I call C function from Java program?
> 
>       Yes - using JNI. The catch is that the overhead introduce by this 
> is such that in most cases the resulting code is almost as slow as an all 
> Java code.

That is, of course, going to depend on how much work the C code does;
"most cases" is sheer handwaving. 

-- 
Chris "(render unto \X that which is X's)(C | Java)" Dollin

Hewlett-Packard Limited registered office:                Cain Road, Bracknell,
registered no: 690597 England                                    Berks RG12 1HN


Re: Shall I move from C to Java? - =?ISO-8859-1?Q?Hans-Bernhard_Br=F6ker?= - 05:21 14-08-07

[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.

| 1 | 2 | 3 | 4 | next