Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How to use GCJ Java compiler


  • Please log in to reply
2 replies to this topic

#1 Romeo29

Romeo29

    Learning To Bleep


  • BC Advisor
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:07:44 AM

Posted 27 July 2009 - 12:50 AM

For some weird reason I had a thought, that I should compile java code into Windows native EXE using GCJ (GNU Java compiler)

I installed MinGW (again) selecting Java compiler. Now I wrote a simple Hello World java program:

public class Hello{  
	public static void main(String args[]){
		System.out.println("Hello, World!");
	}
}

and gave command line:

gcj Hello.java --main=Hello -o Hello.exe

This compiled and created Hello.exe. But when I run it, nothing is displayed. I searched MinGW site and nobody seems to have any problem.

What am I doing wrong ?

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:44 AM

Posted 27 July 2009 - 07:59 AM

Are you trying to run it from the command line, or just double-clicking on it?

#3 Romeo29

Romeo29

    Learning To Bleep

  • Topic Starter

  • BC Advisor
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:07:44 AM

Posted 27 July 2009 - 12:33 PM

From command line. From same command prompt used for compiling

Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users