I’m new to Java.
I’m trying connect to a database but I am not able to compile my test program (helloworld.java)
[root@localhost my_src]# gcc -v
Using built-in specs.
Target: i386-redhat-linux
........... --enable-languages=c,c++,objc,obj-c++,java,fortran,ada..............
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
[root@localhost my_src]# gcc -x java helloworld.java
gcc: error trying to exec 'jc1': execvp No such a file or directory
I know that I have to install JDK to write Java class though, gcc is not enough to compile my helloworld.java? If it’s so, what’s wrong with up there? Anything i’m missing?
GCC is not enough.
You need to have this:
GCJ – The GNU Compiler for the JavaTM Programming Language
http://gcc.gnu.org/java/
Install this on your machine and it’s gonna be ok.
Installation for Redhat/Fedora: