How to convert a big java project to corresponding c++ version?

X

xiebopublic

Hi all,

I want to build a corresponding c++ version for a big java project
(e.g. Geotools(www.geotools.org))? Which is the quickest/easiest way? I
don't want to use the Java VM, then JNI is not suitable.

I know this is a open issue, and I want to know your options.

Thank you!

Best Regards,
Xie, Bo
 
V

Victor Bazarov

I want to build a corresponding c++ version for a big java project
(e.g. Geotools(www.geotools.org))? Which is the quickest/easiest way?
I don't want to use the Java VM, then JNI is not suitable.

I know this is a open issue, and I want to know your options.

You can probably use some kind of translator to get something up and
running quickly, but in all honesty, the two languages are relatively
dissimilar and fixing whatever you got from the translator will take
you more time than redoing it from scratch using the existing Java
application as the design specification. Just my $0.02...

V
 
T

Tomás

posted:
Hi all,

I want to build a corresponding c++ version for a big java project
(e.g. Geotools(www.geotools.org))? Which is the quickest/easiest way? I
don't want to use the Java VM, then JNI is not suitable.

I know this is a open issue, and I want to know your options.

Thank you!

Best Regards,
Xie, Bo

What I'd do:

Try compile it with a C++ compiler, then go through all the errors and
warnings. You'll have to replace "boolean" with "bool"... things like
that.

-Tomás
 
B

Ben Pope

Tomás said:

First question: Why?
What I'd do:

Try compile it with a C++ compiler, then go through all the errors and
warnings. You'll have to replace "boolean" with "bool"... things like
that.

ouch.

I would expect that to cause enough undefined behaviour or outright
stupidity to be a complete nightmare to fix.

Porting a large program requires a large amount of effort. There are no
shortcuts.

I would start by creating lots and lots of test cases for the Java code.
Then I would port the test cases to C++.

Then I would go about reducing the error count by implementing
functionality (from scratch).

It may be useful to extract architectural information out of the Java
codebase and use that to have an understanding of the existing program.

I suspect that whenever you use copy-paste from Java to C++ to expect
more problems than writing it by hand.

Ben Pope
 
X

xiebopublic

The project java version uses a lot of JDK lib. If I want to port the
java project to c++, I must port the related JDK lib. Right? Is there
any c++ version of JDK lib? (e.g. NewJ
(http://www.pure-native.com/newj.html), who has ever evaluated it?)

Best Regards,
Xie, Bo
 
B

Ben Pope

The project java version uses a lot of JDK lib. If I want to port the
java project to c++, I must port the related JDK lib. Right? Is there
any c++ version of JDK lib? (e.g. NewJ
(http://www.pure-native.com/newj.html), who has ever evaluated it?)

Please quote the relevant part of what you are replying to (in
retrospect, perhaps you did that).

I don't know. There is a list of known libraries regularly posted to
this group. Google (groups) it.

Ben Pope
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top