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
0
votes
1 answer

gcj Error - cannot find file for class java.util.function.Predicate

I have a java code which I have to use guava23.0.jar as an external library. More specifically, I need to have these imports: import com.google.common.base.Charsets; import com.google.common.hash.BloomFilter; import…
0
votes
1 answer

instantiating a template class in CNI/C++ code

I have been fooling around with CNI in order to interpolate Java and C++ code for the last few hours. While I was looking the possibility to use the Java collections as a replacement for my old team missing libstd, I tried to create a…
Aviv
  • 414
  • 4
  • 16
0
votes
1 answer

Getting gcj to recognize java-8-openjdk libraries

I'm trying to use gcj to generate a stand alone executable. It works fine with java 1.5 that comes with gcj-4.8 when installed on Ubuntu 14.04. However if I want to use a later version of Java (such as 1.8) gcj doesn't understand the latest language…
Larry
  • 1
0
votes
1 answer

gcj error when trying to compile hadoop mapreduce examples

I am trying to use gcj on hadoop-mapreduce-examples-2.7.1.jar to generate native machine code from the jar file. I need this for my research. But I am getting error: expected type 'java.lang.Throwable' but stack contains 'java.io.IOException' I have…
0
votes
2 answers

Error compiling java code with MinGW gcj

Hey,firends,This is my first post. I'm just begin to using Gcc to compile java,and I have some trouble in doing this. My input and output: import java.io.*; import java.util.*; public class Program{ public static void main (String args[])…
huaigu
  • 557
  • 3
  • 5
  • 9
0
votes
0 answers

If block get executed while condition is false

I am trying to copy a file from one directory to another, everything works perfect except when i try to run Copy.exe am getting an exception. What wrong with the code? why the code withing if statement is executed while the condition is…
Denis
  • 390
  • 3
  • 14
0
votes
1 answer

Gradle build with GCJ

I want to build a Java project with GCJ (https://gcc.gnu.org/java/). Building a non-trivial project would require build automation. Gradle would be a good choice among many. Building a Java project with GCJ is not something standard Gradle plugin…
seongjoo
  • 471
  • 5
  • 16
0
votes
1 answer

GCJ: Java native code, won't run on other machines

I tried GCJ and it compiled fine. I tried both for Ubuntu and windows. The compiled file is running on my Ubuntu machine as well the .exe with wine. But if I tried to run in on my Ubuntu server I got this error: error while loading shared libraries:…
Joey
  • 809
  • 1
  • 10
  • 24
0
votes
1 answer

gcj not finding main class in jar file

I'm new to both gcj and java, so forgive me if I'm missing something obvious. I'm trying to compile YUICompressor using gcj, and I'm getting an error that it can't find the main class. I have: ~/java/yuicompressor.2.4.8> gcj --main=YUICompressor…
John
  • 3,400
  • 3
  • 31
  • 47
0
votes
3 answers

Running Different Bash Commands Based on Java Version

I'm trying to develop a bash build script for a Java project that will be run on Ubuntu and Fedora. Ubuntu uses the gcj compiler while Fedora uses IcedTea. Both report their errors and warning in slightly different ways, and I want to ignore the…
Cerin
  • 60,957
  • 96
  • 316
  • 522
0
votes
5 answers

Differences when compiling Java with GNU Compiler for Java instead of the Sun JDK

I'm working on a school project where I am required to use the GNU Compiler for Java. I've always worked using the official Sun JDK and now I'm concerned about differences that might complicate my work. I'm specially interested in which version of…
Carlos G.
  • 4,564
  • 4
  • 34
  • 57
0
votes
1 answer

can't compile jar with gcj: undefined reference to main

I developed my java project with eclipse and built a runnable jar. Then I tried to use gcj to compile that jar. stefan@api-1:/Sbox/Software/executables$ gcj --classpath=Sbo xSpeakerDependent.jar --main=SboxInterface SboxSpeakerDependent.jar -o…
Stefan
  • 2,603
  • 2
  • 33
  • 62
0
votes
1 answer

Wierd compiler error in GCJ

I was trying to compile some java codes using gcj. I am getting following error. Is it because something in that line is not supported by my gcj? Btw, I am using gcj to see if native codes are any better than bytecodes with latest hot-spot…
-1
votes
1 answer

How to Build gcc 4.2.0 in Redhat 7.0 for backward compatibility?

I must compile gcc 4.2.0 as a program dependency to compile (backward compatibility for a Cobol system). I solved some issues, but now is throwing an exception like this: >/bin/sh ./libtool --tag=GCJ --mode=link…
chech0x
  • 96
  • 7
-5
votes
2 answers

In C++, gets() skips a line

#include using namespace std; vector split(string str, char delimiter) { vector internal; stringstream ss(str); string tok; while(getline(ss, tok, delimiter)) { internal.push_back(tok); } return…
Eddie
  • 1
  • 3
1 2 3 4
5