LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there any tool that can convert my whole Java code to c/c++ (http://www.linuxquestions.org/questions/linux-newbie-8/is-there-any-tool-that-can-convert-my-whole-java-code-to-c-c-824501/)

Nagababa 08-06-2010 12:58 AM

Is there any tool that can convert my whole Java code to c/c++
 
Hi All

As a part of my project I have to write the code from scratch in c/c++ but I already have a full blown Java code available with me. Is there any tool that can do the same.

paulsm4 08-06-2010 01:21 AM

You mean you want to find a tool that'll write your homework for you?

Sigh...

PS:
Yes, Java to C++ translators exist. But the results are seldom satisfactory. And remember: there are fundamental difference between Java and C++ environments ("pointers" and "garbage collection" are two minor things that immediately come to mind ;)). So even if you get something that does a decent job of translating from one syntax to another ... that's still a far cry from having a program that actually works.

Sounds like this is a good opportunity for you to sharpen your C++ skills, my friend...

Nagababa 08-06-2010 02:04 AM

Hi Paulsm

Thanks for your quick reply and with all due respect let me tell you something, the first three lines and the last line were not required.

Tell me the very basic idea behind these forums???? Are these forums meant to comment or criticize on Posts or to HELP????

You have no idea how many years of exp I have or may be I am a fresher. You don't even know whether I am new to java or C++ but even then you wrote something. It looks like you want tell everyone who is visiting this page that you are a ocean of knowledge. If this is the case then I guess there are lot many ways to prove it to world. :-)

Also you are very much concerned about my c++ skills/Homework and all but have you given a single useful link to any site or any link to useful documents??????

You quoted "And remember: there are fundamental difference between Java and C++ environments ("pointers" and "garbage collection" are two minor things that immediately come to mind )."

What other things come to your mind if you give it a thought for few minutes????

Anyways there is no point in discussing this if you can provide me something useful i would be very thankful to you.

Regards
Nagababa

linuxlover.chaitanya 08-06-2010 02:14 AM

@Nagababa,

If you read the rules properly, you will find that homework is not allowed here. You will need to tell what you have already tried and then ask us to help you get out of the deadlock. Just asking people to do your homework will not get you any better responses. And with this attitude on forums where you do not pay members to help you, you have no right to tell what he/she should be doing.
This is a help forum but not where you come and ask members to do your homework.

Nagababa 08-06-2010 03:47 AM

Hi Chaitanya

Please let me clarify I just asked is there any tool that can covert Java code to C/C++ or not.....

and the rest is what one of the senior member has replied it was not me who said its my homework or not, it was not me who said I need to brush up my C++ skills.

I had a very straight forward question. It would have been much more simpler if he would have not said all these. In fact I just replied back to all those things which were not true.

I am really sorry to say it again Chaitanya and with all due respect please don't get biased just because I am new comer to this forum. It was all started from other end and also u r following the suit. From where the ATTITUDE jumped into. I just clarified that neither it is my homework nor my C++ skills are dull. Boss please don't take it other way round.

Regards
Nagababa

TheIndependentAquarius 08-06-2010 04:04 AM

Quote:

Originally Posted by Nagababa (Post 4057655)
Please let me clarify I just asked is there any tool that can covert Java code to C/C++ or not.....

Just search in Google the following and see the results for yourself:
Quote:

java to c++ code converter software
and if Paul (a very knowledgeable member) says
Quote:

Originally Posted by paulsm4 (Post 4057551)
Yes, Java to C++ translators exist. But the results are seldom satisfactory.

you must rethink on using those translators.

linuxlover.chaitanya 08-06-2010 04:04 AM

No. It is not the way it goes. Everyone is a newbie at some point of time. I was and and am still one. You never said it was your homework but the way you phrased you question, it pretty seems it is. What members here like is that you do some work and searching yourself, put some effort and then ask where you are stuck. You show some effort and members here will surely help you out and I have seen members going great lengths to help others.
Paul never meant to disgrace you. Nobody will. But you will have to show your commitment. Instead of arguing on, if you told what steps you have taken till now, you will get better responses. And this is because this is a volunteer forum. Members help others with their own time and effort. So you need to take care on how to ask question properly and what information you need to provide. It is always better to provide as much information as possible.

linuxlover.chaitanya 08-06-2010 04:11 AM

http://www.javakb.com/Uwe/Forum.aspx...Java-converter

You may want to go through this link. It also discusses the point of level of satisfactory conversion of the code. There are links to the softwares as well. But you may want to use and see for yourself.

Nagababa 08-06-2010 04:38 AM

Hi All

Might be it was my mistake I thought of just asking a direct question and I was anticipating a direct answer.

More over I did searched already and have lot of things with me and I thought providing all these info would be a headache to all others who might be reading it.

Here are my findings

1) I got a commercial software (JCGO) to do that part but as Paul mentioned it is not reliable and thinking of migrating the whole Java project to C or C++ is not recommended.

2) The various tar balls that need to be downloaded for JCGO to work are

* jcgo-bin-win32-x86.zip (the JCGO translator executable for Windows development host) [PAD file] [Icon] [Screenshot];
tar ball for unix environment is also there.

* jcgo-src-1_01.tar.bz2 (the source files used by JCGO and by a C compiler);

* jcgo-lib-1_00.tar.gz (the auto-generated Java files used by JCGO, precompiled libraries and auxiliary executables);

* classpath-0.93.tar.gz (the GNU Classpath - Essential Libraries for Java) .
/**********************************************************************************/

After reading all the things I too drew the same conclusion that it can be done but not reliable in some cases, not even readable and also not recommended to migrate the whole Java project to C or C++ using the tool.

But what actually I was expecting the replies to be like; it is possible but u will find the results unsatisfactory or not readable because of "blah blah ..." reasons and facts.

I think I asked in the wrong lingo and ended up in mess. SORRY FOR CREATING A MESS. MY APOLOGIZES to you all.

TheIndependentAquarius 08-06-2010 05:14 AM

Quote:

Originally Posted by Nagababa (Post 4057697)
More over I did searched already and have lot of things with me and I thought providing all these info would be a headache to all others who might be reading it.

Cheer up now :)

It is always a good idea to specify all that you have tried to solve the problem in your first post itself so that one doesn't get a feel that you have posted some home work question. Being specific always helps.

BTW it is very important to make your post readable. Try to refer to the below link to make life easier for others.
http://www.linuxquestions.org/questi....php?do=bbcode

linuxlover.chaitanya 08-06-2010 05:39 AM

Quote:

Originally Posted by Nagababa (Post 4057697)

But what actually I was expecting the replies to be like; it is possible but u will find the results unsatisfactory or not readable because of "blah blah ..." reasons and facts.

First it is always good to give as much information as possible so that others know where you are fixed.
Better is to give what you have tried so that members do not repeat the same solutions that you have already tried and been unsuccessful.

And I guess you had already got the answer you were expecting, in part, from Paul in his post#2. His answer was valid in this context. But you took his pointings a bit too personally.


All times are GMT -5. The time now is 05:10 PM.