LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-29-2011, 01:09 PM   #1
r4jiv007
LQ Newbie
 
Registered: Nov 2010
Location: India
Distribution: Ubuntu;Fedora;Mint
Posts: 11

Rep: Reputation: 0
Question How to convert JAVA class file to C/C++ type binary


hello every one this is my first post here and i wanted to know that is there any method to convert java class file to c/c++ type executable binary as i have created a command line small tool in java which will search and deletes the multiple copy of a file provided with the path to search in ...

Last edited by r4jiv007; 09-29-2011 at 01:19 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-29-2011, 01:26 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Is there any real relevance to the "c/c++" part of your request? Or do you just want a reasonable size self sufficient binary executable (that unlike a .jar file doesn't depend on a JRE)?

If "c/c++" meant something in your request, you ought to explain what/why in order to get a better answer.

Assuming there was no relevance to "c/c++", there are several Java compilers that produce self sufficient binaries. I think GCJ can do that (but I haven't used it myself). See
http://en.wikipedia.org/wiki/GCJ

I have used a different Java to x86 native compiler. But not recently, and I forget its name, and today I couldn't think of a good Google search to find it. Keywords like Java, Native, X86, and Compiler are so common (even all of them near each other) on pages that are not about that at all, that I can't find pages about that (while pages on that topic don't necessarily use those words).

I also only used it on what is otherwise a very big/slow .jar file. So "reasonable size" was in perspective of a fairly bad alternative. For a small Java project, I'm sure such a compiler can produce a self sufficient binary. But I'm not sure "reasonable size" relative to the .jar file is practical for a small project. (I don't know that it isn't practical. I just haven't tried and can think of reasons it wouldn't scale down well to tiny projects).

Last edited by johnsfine; 09-29-2011 at 01:42 PM.
 
2 members found this post helpful.
Old 09-29-2011, 09:53 PM   #3
r4jiv007
LQ Newbie
 
Registered: Nov 2010
Location: India
Distribution: Ubuntu;Fedora;Mint
Posts: 11

Original Poster
Rep: Reputation: 0
well there is no real relevance to c/c++ type binary ... i want it the same way as you mentioned ..
let me try GCJ .. and post the result ..
Thanks for rply
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] C++ Initialize Class Member Variables of Another Class Type mirlin510 Programming 9 04-13-2011 11:46 AM
how to run .class java file? rabbit2345 Programming 2 01-24-2008 10:43 AM
converting a hex file to binary linx win Programming 3 07-20-2006 03:04 AM
Java FTP file class? caged Programming 3 03-19-2005 09:01 PM
executing java class file niranjan_mr Linux - Software 1 12-27-2004 02:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration