GCJ is the GNU compiler for the Java programming language. It can compile Java source code to Java bytecode, or directly to native code.
Questions tagged [gcj]
75 questions
2
votes
3 answers
using cygwin compile java file to windows native code
I have written a small java application for one of my homework. the problem is the teacher may not have JRE installed. what i want to id to compile the java file to window exe file so the teacher can run it without the JRE installed.
i use the gcj…

danny
- 1,095
- 2
- 12
- 27
2
votes
1 answer
GCJ for NetBeans
How can I compile a Java program by GCJ compiler in NetBeans? Is there any plugin for it?

ehsun7b
- 4,796
- 14
- 59
- 98
2
votes
1 answer
GJC - an external jar
Please don't go into a rant why I shouldn't be using GJC, I understand the con's of it.
The question is, can I link a compiled library just as if using a regular jar?
// this works and links to the jarfiles.jar
java -cp lib/jarfiles.jar:classes…

Frankie
- 24,627
- 10
- 79
- 121
2
votes
2 answers
Anyone here have any experience using gcj's CNI for java external libraries?
I've been interested in doing some work on a desktop application for while now and my most proficient language is Java. Due to wanting to be able to compile down to a native executable, does anyone have any experience they would like to share about…

sdellysse
- 39,108
- 9
- 25
- 24
2
votes
2 answers
Combining Java and C without gcj -- move C to Java or Java to C?
First, I have no experience doing this. But like the beginning of any good program, I have problem that I need to fix, so I'm willing to learn.
So many of you are probably already familiar with pdftk, the handy utility for handling various…

Anthony
- 36,459
- 25
- 97
- 163
2
votes
3 answers
Referencing libraries for a Linux executable
I have written an application in Java and succesfully compiled it using gcj. It worked surprisingly well, but I've run into a hurdle: I can only run the executable through a shell script, because I have to specify the library paths.
The libraries I…

Paul Lammertsma
- 37,593
- 16
- 136
- 187
2
votes
2 answers
How To Ignore Warnings With GCJ
I have some classes that implement interfaces, some of which have methods whose parameters are by definition unused in the particular class implementation. e.g. A "Shape" interface may define a "contains(point)" method, but my particular class…

Cerin
- 60,957
- 96
- 316
- 522
2
votes
0 answers
the program javac can be found in the following packages ubuntu
typing
$ java -version
The program 'java' can be found in the following packages:
* gcj-4.4-jre-headless
* gcj-4.5-jre-headless
* openjdk-6-jre-headless
Try: sudo apt-get install
I've installed oracle…

gva
- 21
- 3
2
votes
1 answer
How can I compile files separately with gcj?
I use gcj (Cygwin version) to compile 2 java files
$ gcj --version
gcj (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is…

Luc M
- 16,630
- 26
- 74
- 89
2
votes
1 answer
How do you link the correct ABI versions with GCJ for foregin jars?
I had decided to try and compile minecraft into a native binary.
For that I used the following (approximately, optimization may have differed):
gcj -c -O2 -fjni -findirect-dispatch ./minecraft.jar &
gcj -c -O2 -fjni -findirect-dispatch ./jinput.jar…

Not a Name
- 993
- 7
- 18
2
votes
2 answers
How to Compile Java Servlets and many other classes with GCJ?
Currently i have a back-end system written in Java that process, massage and forward the data to a external HSM module for encryption. It was consider secure enough back then. However, recent audit findings requires all back-end Java classes to be…

Reusable
- 1,888
- 7
- 27
- 46
1
vote
2 answers
Scanner class in Java5 throw java.lang.NullPointerException
I am using scanner class in java5, and the following code will throw an exception:
Scanner scanner = new Scanner
(new File(args[0]));
int dealId;
while (scanner.hasNextLine()) {
dealId = scanner.nextInt();
…

cheng
- 2,106
- 6
- 28
- 36
1
vote
2 answers
How do I link jar packages together with *.java files during compilation using GCJ?
I have the following files:
A.jar (containing *.class files)
B.jar (containing *.class files)
Program.java (containing Program class with main function, which depends on A.jar and B.jar)
How can I build an executable file Program using GCJ?

Andrei Sedoi
- 1,534
- 1
- 15
- 28
1
vote
1 answer
GCJ throws error: "Undefined reference to main" when compiling
I´d wanted to compile a simple Java "Hello World" program like it was repesented on the GeeksforGeeks Hello World Tutorial, by using gcj in Linux Ubuntu. This is the source code:
class HelloWorld
{
public static void main(String args[])
…

RobertS supports Monica Cellio
- 14,524
- 7
- 33
- 80
1
vote
3 answers
GCC GCJ needs ECJ and Other Libraries?
So I just downloaded mingw-w64-bin_i686-mingw_20110410.zip from here (GCC 4.7 apparently), and discovered it had a very recent version of the GCJ compiler.
I tried using it, but apparently gcj requires ecj1.exe, which is the Eclipse compiler for…

user541686
- 205,094
- 128
- 528
- 886