2

I have gotten this error:

Compilation failure
Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

Now I have set some info in my .bashrc file like so: export PATH=$PATH:/usr/lib/jvm/java-6-openjdk/bin. I also did it in my /etc/profile file. But it still fails. But I am noticing that the above error is still going into jre instead of jvm. I don't really understand why its doing that. When I do which javac, it directs me to /usr/bin/javac. What exactly is that file? It seems Ubuntu defaults to JRE rather than the SDK. Either way I am confused as to how to fix this. Any help would be appreciated!

Andy
  • 10,553
  • 21
  • 75
  • 125
  • 1
    Did you also set JAVA_HOME? I don't think Maven cares much about PATH. – Thilo Feb 26 '13 at 01:04
  • Originally when I did `echo $JAVA_HOME` it was empty. So I don't think that made a difference. And thanks for your time. – Andy Feb 26 '13 at 01:10
  • It says unable to locate java7, you have java6 in your path. was that the problem? – Sionnach733 Feb 20 '14 at 16:02
  • 1
    @Sionnach733 Actually my problem was with the default alias for java. As it turns out the defaults can't simply be changed by pointing to the correct folder, but rather the alias must be changed using the systems java symlink helper. I find this weird that other people haven't had this problem as much as I have as is obvious with no one answering it. When I get a chance I should probably just answer my own question. – Andy Feb 20 '14 at 16:54
  • @Andy yes, post answer please – Sionnach733 Feb 20 '14 at 16:59

0 Answers0