• Post Reply Bookmark Topic Watch Topic
  • New Topic

unrecognised class file version  RSS feed

 
Krep Lock
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've unwillingly switched platforms to linux, so I'm a noob all over again.

Here's my test program:


Here's what happens when I try to compile and execute from the command line:



the jdk is located in /jdk1.6.0_05
I have a symlink /usr/bin/javac pointing to the /jdk.../bin/javac file. Yet I am denied.
 
Krep Lock
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it working... it looks like just showing up at the java ranch gave me that couple extra IQ points to solve this riddle.

/usr/bin/java was the default jre installation, which apparently is not ompatible to the jdk that I installed. Easily fixed by:

#mv /usr/bin/java /usr/bin/java.old
#ln -s /jdk.../bin/java /usr/bin/java

 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm pretty sure the reason for your problem is that you're using a GNU Java compiler instead of the one located in your JDK installation. Unfortunately I don't have any experience with this compiler but a lot more with linux and Java development on linux and this error message sounds like a problem with gcj (GNU compiler) or a library of it not with the JDK or your test program.

Maybe the GNU compiler is located in your search path before the JDK compiler. You can check this by typing "which" on the command line. This tells you which version of javac is used on your system if there should be more than one. Please take a look if this is really the JDK compiler! Possibly the symlink you created doesn't work like expected or something like this.

Just let me know if you can't figure out the problem!

Marco
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!