File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes C to Java (stuck) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "C to Java (stuck)" Watch "C to Java (stuck)" New topic

C to Java (stuck)

Scott Jones

Joined: Nov 05, 2004
Posts: 1
I'll start with a little history, my crazy java teacher hasn't taught us nearly anything all semester, and now he decides to give us a final on something he's never done before. He asked us to convert a c program into java. Oh, he said we could use any resorces we could get our hands on, so here i am .

This is what i have done so far. I downloaded c2j and converted the c files into java. I then loaded those java files into blue J. It compiles, however, it never launches a program. I'm assuming im missing something obvious but like i said, i'm new to this so have mercy lol.

The goal is to get the code in those files into java and make a program start. It is suppost to be a fractal compression program.

Take a look at and/or download the c souce or my current progress, feel free at

Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
I get the impression your teacher is looking for you to convert the program, not for a C-to-Java converter to do it for you. Java is very much like a "Super C", and it uses many of C's constructs, so you should be able to figure out how to do the same thing in Java that you do in C. I recommend going to, downloading the tutorial, and at least read "Your First Cup of Java". Then you can post more-specific questions about your project rather than asking us to do your homework for you. Good luck!

Give a man a fish, and he eats for one day; teach a man to fish, and he eats for a lifetime.
[ November 05, 2004: Message edited by: Jeff Bosch ]

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
As a side note - posting the same question on multiple forums will likely get you a pretty similar answer

<a href="" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
Seems to be a lot of that happening around these here parts lately. (Sorry about the bad drawl - it's Friday afternoon and my brain is hurting for some entertainment!)
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
BTW, do you know any C?
Do you know any Java?

Mike Gershman
SCJP 1.4, SCWCD in process
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
I'm assuming that question is directed at the original poster.

Rose Evans
Ranch Hand

Joined: Oct 14, 2004
Posts: 195

Tell me, did you take C++ I and II? I'm currently taking C++ II and it is confusing as ever! And along with that, I am in my first class of Java, which blows my mind as well. However, I have noticed I'm getting pretty good with applets. They are so fun. I guess, like my teacher told me, I'll be an applet queen someday. Ha.
Good luck with your progress.

) ) ) )
I agree. Here's the link:
subject: C to Java (stuck)
It's not a secret anymore!