Questions tagged [gcj]

GCJ is the GNU compiler for the Java programming language. It can compile Java source code to Java bytecode, or directly to native code.

75 questions
59
votes
10 answers

Is this valid Java?

Is this valid Java? import java.util.Arrays; import java.util.List; class TestWillThatCompile { public static String f(List list) { System.out.println("strings"); return null; } public static Integer…
lacroix1547
  • 1,050
  • 1
  • 8
  • 16
40
votes
4 answers

Is GNU's Java Compiler (GCJ) dead?

As of October 2010, is GNU's Java compiler dead? Are there any active alternatives (especially for compiling Java to native code)? LLVM solutions would be preferred.
Alon Gubkin
  • 53,054
  • 52
  • 181
  • 282
22
votes
6 answers

Java JRE vs GCJ

I have this results from a speed test I wrote in Java: Java real 0m20.626s user 0m20.257s sys 0m0.244s GCJ real 3m10.567s user 3m5.168s sys 0m0.676s So, what is the purpose of GCJ then? With this…
Martijn Courteaux
  • 63,780
  • 43
  • 187
  • 279
21
votes
5 answers

JDK, JRE, Java: Version Confusion!

Although I'm not a real Java developer (yet), I feel like I should know this by now, but I'm still very confused. My question has two parts: What is the difference between the so-called (as I've seen it) "Sun JDK", OpenJDK, and GCJ? At various…
Brian Lacy
  • 17,820
  • 9
  • 50
  • 73
21
votes
2 answers

extern "Java" block in GCC

I found an interesting feature in GCC documentation for C++: java_interface This type attribute informs C++ that the class is a Java interface. It may only be applied to classes declared within an extern "Java" block. Calls to methods declared in…
Ihar
  • 305
  • 1
  • 10
13
votes
8 answers

Is GCJ (GNU Compiler for Java) a viable tool for publishing a webapp?

Is it really viable to use GCJ to publish server-side applications? Webapps? My boss is convinced that compiling our (my) webapp into a binary executable is a brilliant idea. (Then again, he likes nice, small simple things with blinky lights…
Stu Thompson
  • 36,763
  • 19
  • 104
  • 155
7
votes
3 answers

Calling Java library (JAR) from VBA/VBScript/Visual Basic Classic

There is jar library native C++ port is not yet available (as DLL) I need to call from I have 3 possibilities: 1) Wait until native port is ready 2) Use JAR library from VB via brigde (?), installed JRE required 3) Compile JAR into native DLL using…
hellboy
  • 1,329
  • 5
  • 18
  • 50
7
votes
3 answers

Invoking C++ code from Java (GCJ)

I'm trying to invoke C++ from Java using GCJ using the CNI, so far I'm able to invoke Java code from C++. How can I invoke C++ from Java using the CNI?
Joe D
  • 2,674
  • 2
  • 27
  • 25
6
votes
2 answers

Alternative `pdftk multistamp` to `pdftk` once it's no longer available?

I'm using pdftk multistamp on a server for adding custom page numbering, page headers and page footers to big (500-1200 pages) PDF files. I do this by counting number of pages in the input, creating suitable empty pages with page numbers, headers…
Mikko Rantalainen
  • 9,490
  • 8
  • 53
  • 86
6
votes
1 answer

How to use GCJ with Ant?

I'm fairly new to both Apache Ant and GCJ, and I'm having a hard time trying to build with GCJ via Ant. My app is in Scala, so I need to use GCJ to take .class files as source. No problem compiling .scala to .class with Ant. First I figured out how…
Germán
  • 4,287
  • 3
  • 27
  • 35
6
votes
1 answer

Why doesn't GCJ find the classes from my imported packages?

I want to compile a small Java application to a Windows executable. The application is very small, only a single main class, but it uses Apache POI. When I compile it, everything works fine, as long as I put the POI Jar into the class path…
Daniel Rikowski
  • 66,219
  • 52
  • 237
  • 318
5
votes
1 answer

Integrate c/c++ with Java native code as shared library (compiled by gcj)

gcj can compile Java code into native code. I am interested if Java is compiled into shared library, how we can use methods from the library in c/c++ programs. I didn't succeed. The following is my attempt: Java code (will be compiled into shared…
qinsoon
  • 1,271
  • 2
  • 13
  • 28
5
votes
2 answers

Is GCJ still in development?

I've been searching for information about the state of GCJ and it's future but especially for the future was nothing to find... Is GCJ dead?
Goonex
  • 51
  • 3
5
votes
1 answer

How do I print a Java array in gdb?

I compiled a very simple java program with gcj-4.4 and -o option. I loaded it in gdb-7.2 and tried to do some debugging. I noticed at I could print the variables in int type but I could not print an array of int. I received this error message: (gdb)…
John Chain
  • 632
  • 4
  • 9
5
votes
1 answer

How to create a compiler Action for SBT

I want to create an Action to automate GCJ compilation. Since I couldn't make it work with Ant, I decided to try SBT. The docs say how to create an Action and how to run an external process. What I don't yet see is how to reuse the directory tree…
Germán
  • 4,287
  • 3
  • 27
  • 35
1
2 3 4 5