top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can GCC be used as Java-compiler?

0 votes
442 views

Can I use gcc as well as java compiler on a single desktop?

posted Nov 3, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

I think your query is whether we can use c code in java or not. If this is your question then my answer is "yes". You can call c based function from your java code using the Java Native Interface mechanism.

http://subhayan-mukerjee.blogspot.in/2012/01/integrate-c-code-within-java-code-using.html

If your query is related to installing gcc and java both in a system then there is no issue. A system can have both java compiler as well as c compiler.

answer Nov 5, 2016 by Rupam
Similar Questions
+2 votes

Advance apologies if this question has been asked previously, Google searches only turned up results for using -fPIE/-fPIC.

Is it possible to build GCC as a PIE? If so, would it be a matter of including the -FPIC/-FPIE params for CFLAGS and/or LDFLAGS and running configure && make, or are there issues I should be aware of (for example, should I set parameters for cross-building)?

Background: Android 5.0 requires PIE, which means that upgrading will break my existing native build environment...unless I can build a PIE GCC first, then re-build all of my utilities with it.

0 votes

I am looking for detailed description of optimization flags that are provided by GCC compiler ?

+1 vote

So far I've been editing some makefile in order to get a debuggable compiler. I tried the instructions at

http://gcc.gnu.org/wiki/DebuggingGCC

I did

cd myobjdir
../gcc4/configure --prefix=/my/disk/usr/hgreving/sysroot_4_8_1 --program-prefix=special- --program-suffix=-4.8.1 
make STAGE1_CFLAGS="-g -O0" all-stage1
make install

I am getting this error:

/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [install-fixincludes] Error 1
make[1]: Leaving directory `/my/disk/usr/hgreving/myobjdir'

Is there something very obvious that I am doing wrong?

...