1

I ran:

javac Perf.java

and got:

ERROR in Prefs.java (at line 36)

HashMap<String, String> map = new HashMap<String, String>();
        ^^^^^^^^^^^^^^
Syntax error, parameterized types are only available if source level is 1.5

When I type: java -version I get:

java version "1.6.0_0"
IcedTea6 1.4 (fedora-11.b14.fc10-i386) Runtime Environment (build 1.6.0_0-b14)
OpenJDK Client VM (build 14.0-b08, mixed mode)

javac -version gets me:

Eclipse Java Compiler 0.883_R34x, 3.4.1 release, Copyright IBM Corp 2000, 2008. All rights reserved.

This is a fresh install of Fedora 10. What is this icedtea business? Why is the Java compiler defaulting to the Eclipse compiler? Someone explain this madness...

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
Alex
  • 6,843
  • 10
  • 52
  • 71

2 Answers2

1

Fedora as default use Open Source software. Icedtea is the redhat adaptation of the OpenJDK to be fully open source. The Eclipse compiler is the best open source command line java compiler out there, but it appears not to be compiling for Java 6 per default.

Try "javac -help" to see what options you have. It may be just a simple environment variable which needs tweaking.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
1

Check your $PATH variable. It sounds like your "java" executable is in one place and the "javac" is somewhere else.

Try the "where" or "which" command on the command line - this will tell you where the shell/OS is locating each of these executables:

which java
which javac
Andy White
  • 86,444
  • 48
  • 176
  • 211
  • Both are in the same location: /usr/bin/java[c| ] – Alex Mar 25 '09 at 04:04
  • You may need to (re)download the Java SDK then. It sounds like your OS shipped with a strange/non-standard version of javac – Andy White Mar 25 '09 at 04:05
  • redhat fedora 10 has been 90% fail so far – Alex Mar 25 '09 at 04:06
  • oh man... that blows :(. I've never had much luck with the preinstalled versions of java. I always like to just download the latest JDK so I know exactly what I'm dealing with. – Andy White Mar 25 '09 at 04:08
  • Sigh... one day there will be a version of linux I am impressed with. That day is not today. – Alex Mar 25 '09 at 04:14
  • The version of java / javac installed by default on Fedora is actually based on gcj. It's a native compiler, not a JVM, designed to provide basic compatibility. You should get the OpenJDK or the Sun standard version instead. – Varkhan Mar 25 '09 at 04:19
  • If you really want a Unix with good Sun Java support pr default, use OpenSolaris. The latest release is quite good. – Thorbjørn Ravn Andersen Jun 19 '09 at 21:10