Java to C++ (simple tool)

S

Stefan Poehn

Hi

does anybody know a tool that converts Java-Code to
C++? I need a very simple converter that does NOT need to
cover Threading, Swing, Exceptions, Reflection, RMI,
Security, Networking and most of java.util (except LinkedList).
It also does not need to cover garbage collection (new is not allowed
in the java code that should be converted).

TIA
Stefan
 
G

Gordon Beaton

does anybody know a tool that converts Java-Code to C++? I need a
very simple converter that does NOT need to cover Threading, Swing,
Exceptions, Reflection, RMI, Security, Networking and most of
java.util (except LinkedList). It also does not need to cover
garbage collection (new is not allowed in the java code that should
be converted).

"new" isn't allowed in the Java code?

Are you an aspiring Georges Perec?

Sorry, I don't have an answer to your question.

/gordon
 
S

Stefan Poehn

Gordon Beaton said:
"new" isn't allowed in the Java code?
in the java code _that should be converted_. This is a limitation we define.
Are you an aspiring Georges Perec?

I don't know Mr. Perec but I am sure I am not
an aspiring Georges Perec.
 
S

Stefan Poehn

Roedy Green said:
One approach is just to compile it with the C++ compiler and fix the
errors.

Sorry, I forgot one requirement we have:
The code must be converted automatically without fixing some
errors after converting. Converting should be done very often
in this project.

Stefan
 
T

Tor Iver Wilhelmsen

Stefan Poehn said:
The code must be converted automatically without fixing some errors
after converting. Converting should be done very often in this
project.

Er, why the need for C++? You can compile the Java code to native
using Gnu GCJ, part of the later GCC releases.
 
S

Stefan Poehn

Tor Iver Wilhelmsen said:
Er, why the need for C++? You can compile the Java code to native
using Gnu GCJ, part of the later GCC releases.

Not on our target platform. We have neither a java interpreter nor a
java native compiler :-(
Target platform is presumably QNX with not much memory, and is
likely to change to some other platform which we don't even know
now. The only thing that's sure is that there is an ANSI C++ compiler
on the target platform.

Stefan
 
R

Roedy Green

Target platform is presumably QNX with not much memory, and is
likely to change to some other platform which we don't even know
now. The only thing that's sure is that there is an ANSI C++ compiler
on the target platform.

There is a QNX JVM, from IBM.

"Users of the QNX® Neutrino® RTOS can now take advantage of IBM
WebSphere Micro Environment 5.5, a small, fast, production-ready
solution for deploying Java applications in telematics systems, mobile
devices, realtime control systems, and numerous other "smart"
products."

This is obviously not full Java, but it might be easier to get your
app to work under this that converting it to C++.

There is another at http://www.embedded.oti.com/wme/
 
S

Stefan Poehn

Roedy Green said:
There is a QNX JVM, from IBM.

"Users of the QNX® Neutrino® RTOS can now take advantage of IBM
WebSphere Micro Environment 5.5, a small, fast, production-ready
solution for deploying Java applications in telematics systems, mobile
devices, realtime control systems, and numerous other "smart"
products."

This is obviously not full Java, but it might be easier to get your
app to work under this that converting it to C++.

Thank you. That would be the solution we prefer, but our customer
does not want to run a JVM on this machine, to save memory.
You are right, we have to make much more effort, but apparently
this is the best way for the whole project (we are developing only
one component).

Stefan
 
T

Thomas Weidenfeller

Stefan Poehn said:
Not on our target platform. We have neither a java interpreter nor a
java native compiler :-(
Target platform is presumably QNX with not much memory, and is
likely to change to some other platform which we don't even know
now. The only thing that's sure is that there is an ANSI C++ compiler
on the target platform.

Then I would strongly suggest to develop in C++ right from the
beginning. Faith in the Java religion will not gain you anything. You
are shooting yourself in the foot if you want to go for transpiling in
that situation.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top