asimmittal
December 29th, 2007, 07:31 PM
Hey,
I have looked at quite a few threads before finally posting this up. I dunno what I'm doing wrong.
asim@asim-laptop:~$ cd /media/hda6/Codes/Java/
asim@asim-laptop:/media/hda6/Codes/Java$ java Ascii_Chart
Exception in thread "main" java.lang.ClassFormatError: Ascii_Chart (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.7)
at java.lang.ClassLoader.defineClass(libgcj.so.7)
at java.security.SecureClassLoader.defineClass(libgcj .so.7)
at java.net.URLClassLoader.findClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.Class.forName(libgcj.so.7)
at gnu.java.lang.MainThread.run(libgcj.so.7)
asim@asim-laptop:/media/hda6/Codes/Java$
now I've been using java on windows, and this kinda reply would mean only one thing - classpath is not set.
I have downloaded jdk1.6 from the java.sun download page. It was a .bin file which i unpacked in the terminal. The result was the "jdk1.6_03" folder which i have placed in some remote directory. I then proceeded to set my path (by editing .bashrc) to my jdk directory.
Everything was fine... javac command was now being recognized. However, every time I use "java", it throws the classpath exception. Then I tried altering the /etc/environment file. Same result... no change.
Can anyone please help me out. I'm running a Dapper on a Pentium4 processor.
P.S: I installed netbeans ide, and specified my java directory. If i execute a file there, within the IDE - it does everything perfectly. But I want to use the command line only. Please help
I have looked at quite a few threads before finally posting this up. I dunno what I'm doing wrong.
asim@asim-laptop:~$ cd /media/hda6/Codes/Java/
asim@asim-laptop:/media/hda6/Codes/Java$ java Ascii_Chart
Exception in thread "main" java.lang.ClassFormatError: Ascii_Chart (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.7)
at java.lang.ClassLoader.defineClass(libgcj.so.7)
at java.security.SecureClassLoader.defineClass(libgcj .so.7)
at java.net.URLClassLoader.findClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.Class.forName(libgcj.so.7)
at gnu.java.lang.MainThread.run(libgcj.so.7)
asim@asim-laptop:/media/hda6/Codes/Java$
now I've been using java on windows, and this kinda reply would mean only one thing - classpath is not set.
I have downloaded jdk1.6 from the java.sun download page. It was a .bin file which i unpacked in the terminal. The result was the "jdk1.6_03" folder which i have placed in some remote directory. I then proceeded to set my path (by editing .bashrc) to my jdk directory.
Everything was fine... javac command was now being recognized. However, every time I use "java", it throws the classpath exception. Then I tried altering the /etc/environment file. Same result... no change.
Can anyone please help me out. I'm running a Dapper on a Pentium4 processor.
P.S: I installed netbeans ide, and specified my java directory. If i execute a file there, within the IDE - it does everything perfectly. But I want to use the command line only. Please help