LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java compilation error says-"Parameterized types available if source level is 5.0" (https://www.linuxquestions.org/questions/linux-newbie-8/java-compilation-error-says-parameterized-types-available-if-source-level-is-5-0-a-801503/)

anushya.k.kutty 04-12-2010 04:14 AM

Java compilation error says-"Parameterized types available if source level is 5.0"
 
While compiling java programs, i get the error as "parameterized types available only if source level is 5.0". I have a default java 5 in my debian os and i have installed java 6.
I have also set the classpath in .bashrc file as follows:

1. export $JAVA_HOME=/home/....../jdk1.6.0_18
2. export PATH=$PATH:$JAVA_HOME/bin

What might be wrong with my java installation??

PMP 04-12-2010 04:34 AM

give the output of
Code:

java -version
echo $PATH

from the shell you are trying to compile the java code.

anushya.k.kutty 04-16-2010 06:35 AM

sorry for the late reply..

java -version gives the following output

java version "1.5.0"
gij (GNU libgcj) version 4.3.2

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

echo $PATH gives the output
/usr/local/bin:/usr/bin:/bin:/usr/games:/dalu/jdk1.6.0_18/bin

PMP 04-16-2010 06:57 AM

This seems to me that java used is gij ? the GNU one
do

which java
Post the output.

Add the path of the java to the beginning of the path instead at end.
and then check

which java

anushya.k.kutty 04-16-2010 12:52 PM

which java
gave the output as /usr/bin/java

I Added the path of the java to the beginning but no change...


All times are GMT -5. The time now is 01:32 PM.