running .java using terminal?

ov3rdo5e

Registered
I am about to graduate and the final hand in is in less than two weeks, but I've encountered a major problem: I used to lauch my program under windows using command line; if i try the same method under mac using terminal the program doesnt run and i get back:

Unknown-00-22-41-f8-83-b5:bin chloemarsh$ java main.MainGUI
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
Unknown-00-22-41-f8-83-b5:bin chloemarsh$

any help would be a lifesaver because uni provides us only with mac's and my program wont run on them ;(
 
Giving the error messages serves a purpose. However, it might be more useful to discuss the Java application. I have not encountered a single Java-based application on the Mac that I can't run by simply double-clicking it. If you have a Java application that requires Terminal or console access, then I don't believe that it will run on the Mac. If it did, then it would be a major security hole.

Bottomline: Tell us about the program.
 
I think the error message says that you have compiled the file using different compiler to the virtual machine (i.e. javac and java are not of same version).
 
it was compiled on pc where the .class files were created. should i just compile them again using javac command in terminal? or is there a better way of doing this?
 
the program basically compares two pictures and then moves another very long image accordingly. it work like a motion sensor - when somebody walks past the screen the image moves with him. and that leads to another problem i could use help with: is there a program that would automatically take and save pictures under specified name [overwriting the previous one] and into a specified folder available for mac os? for pc i use active webcam but i couldn't find an equivalent for mac :(
 
Back
Top