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
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
  • 658
  • 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,525
  • 3
  • 31
  • 37
5
votes
3 answers

With gcj compiled java & XStream. (Exception: Cannot create XmlPullParser)

I'm enhancing a client, which is part of a bigger project. Because of the lack of speed i was forced to switch to CNI and therefore i had to generate native code with the GNU-gcj compiler (gnu 4.6.3). The compiling and linking works fine (thanks to…
Chris
  • 51
  • 1
  • 4
5
votes
3 answers

Does compiling Java to native code protect the source code?

Now, I know that... Anything can be reverse engineered, given enough time and resources. However, would compiling your Java code to native code with a tool like GCJ make it more difficult to decompile? I mean, given a few minutes, I can decompile…
tehtros
  • 179
  • 7
4
votes
1 answer

Possible to use GCJ to produce library callable from Python?

Is it possible to compile a library intended for Java with GCJ, get a dll and call from python ctypes? I'm interested in toxilibs for now, but if anybody knows a toy example that would be great !
Stuart Axon
  • 1,844
  • 1
  • 26
  • 44
3
votes
0 answers

gcj compile to arm

I am trying to build micro libgcj for android ndk. I can get to build find but when I try to link libulibgcj.a I get invalid format error. I think it is because of gcj not compiling to arm. Two static libraries are built libgc.a and libulibgcj.a. I…
3
votes
1 answer

Statically Linking a GCJ Application on Ubuntu Natty

I'm trying to statically link a GCJ application and it looks like theres some misconfiguration somewhere. I'm just using the standard gcj installation on natty and I have both libgcj11 and libgcj11-dev installed. My test application is: class…
Adam
  • 463
  • 2
  • 6
  • 14
3
votes
1 answer

Does the GNU Java compiler support JNA?

I want to write a java program that uses the Windows API and that compiles to native code instead of byte code. I don't want using JNI (C, C++, ... interface) but instead want to write using pure java code and JNA. Would the GNU Java compiler…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
3
votes
1 answer

I'd like to cross-compile a gcj program for windows in linux

I already have my program compiling on the linux gcj, but i'd like to statically compile for windows. I've failed for linux. It always says: /usr/bin/ld: cannot find -lgcj collect2: ld returned 1 exit status Has anyone succeed at this (a portable…
i30817
  • 1,356
  • 2
  • 13
  • 26
3
votes
1 answer

Java BigDecimal alternative library

This may strike as particularly odd but I must compile several new code against GCJ; that doesn't support Java's BigDecimal. What I'm looking for is an alternative to java.math.BigDecimal. Can anyone point me in the right direction? Thanks!
Frankie
  • 24,627
  • 10
  • 79
  • 121
3
votes
2 answers

Compile complex Java Program in native code using GCJ

I have a java program consists of a jar for the "real program" and a sub-folder containing 20 jar library files (also have dependencies between them). I tried but without success ... I'm missing with the many options that gcj to compile :(. Does…
Alan
  • 31
  • 3
3
votes
1 answer

Mutually recursively defined static fields causes program to freeze but not without threads and not with gcj?

Here is some simple code: class B {final static int x = C.x;} class C {final static int x = B.x;} class A { static { System.out.println("A static{}"); new Thread() { public void run() { new B(); }}.start(); new Thread() {…
Dog
  • 7,707
  • 8
  • 40
  • 74
3
votes
1 answer

How do I link two Java files together during compilation using GCJ?

My apologies as I'm very much a "Java noob." Anyways, I think I've dumbed this problem down sufficiently to ask in a way that is straight-forward and will get me the answer I want. Let's say I have two files, both in my home directory, as…
soapergem
  • 9,263
  • 18
  • 96
  • 152
2
votes
2 answers

Going from a bunch of .Java files to a .Jar file from the commandline with one simple command

I've searched around and I can't find a simple commandline tool that will take a bunch of .java files in a directory and compile to .class files then stick them all in a .jar automatically. I could probably write a script myself but this is one area…
TheIronKnuckle
  • 7,224
  • 4
  • 33
  • 56
2
votes
2 answers

Java Scanner : "0" is not a double

I have a problem with the java Scanner : I'm trying to read doubles using this code : Scanner sc = new Scanner(System.in); double value = sc.nextDouble(); However when the number to read is "0.0" or "0." or "0" I have the following error…
Loïc Février
  • 7,540
  • 8
  • 39
  • 51