How To Change Java Compiler in Ant on Fedora Core / Linux

By Angsuman Chakraborty, Gaea News Network
Friday, June 22, 2007

Fedora Core team, in its infinite wisdom, decided to ship a so-called “free” (but essentially useless and crappy; pardon my French) JVM (read gcj) with its installation. Not only that this “free” JVM is integrated with java softwares from Fedora repositories making them pretty hard to use too. I think this is a ridiculous decision by the Fedora Core team. Anyway so we are stuck with ant which somehow, as if by magic, picks up the old gcj based Java compiler, even though I have installed JDK 1.6 on my machine and the executables are in path.

I tried several options to force ant to use the JDK 1.6 compiler but without any success. For example I tried specifying the path of javac executable, specified the source and target etc. Finally I stumbled upon a simple solution.

In Fedora Core ant can be configured using /etc/ant.conf. I simply opened the file and specified the JAVA_HOME there like:
JAVA_HOME=/usr/java/latest

That’s all it took to override its default settings.

Discussion

mandela900
August 7, 2007: 10:23 pm

senti questo e quello che serve per il problema del quale hai parlato
—————————————————-
vai sul sito della java scarichi il pacchetto JDK 1.6 per linux no il rpm autoextraente ma il bin dopo che hai il pacchetto entri come root e spostalo JDK 1.6.bin in /opt dopo vai in /opt e fai chmod +x JKD1.6.bin dayi un bell yes a la licensa e ti crea la cartella a questo punto puoi cancelare il file bin ma la cosa no finisci qua visto che bisogna dirle a fedora che versione usare di java “alternatives –install /usr/bin/java java /opt/cartella_jdk/bin/java 2″per commodita usare il auto completamento,adesso facciamo “alternatives –config java”e scegliamo quella che aviamo messo noi in /opt quindi la cosa e chiara per piu chiarimeti andate su https://www.fedoraonline.it

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :