0

I am receiving java bad version number in .class file when I try to open a simple applet in my browser (I have tried Firefox and Safari). My browsers stat that I am using a 1.5.X JRE, but my command line compiler is 1.6.x. I can't quite figure how to sync the two of these VM's, as I am not the most adept Mac user. I have tried the native software update feature, but there is no Java update available there. I've also tried updating in each browser, but I just get redirected to the Mac OS X Software Update feature.

1
  • 1
    Well trying to update the VM on your command line isn't going to be much use - 1.6 is the latest supported update from Apple. What browser versions are you using? You probably need to update to current versions of Safari and Firefox.
    – Perception
    Commented Feb 4, 2012 at 2:30

2 Answers 2

1

while compiling files, you have to use -target option.

Example, javac -target 1.5 [source file]

More explanation is available at http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/javac.html

1

For an Oracle JDK, you'd simply use the cross-compilation options of javac.

Note that is important to specify -source, -target & -bootclasspath for the compilation. That last one requires a JRE of the target version, to check the classes, methods & attributes used in the code actually existed in the target version.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.