• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unrecognised class file version

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic