DIGIT-ARC read-only archive · snapshot: July 23, 2026

Executing Class File in Ubuntu!

6 posts · originally from https://geek.digit.in/community/threads/executing-class-file-in-ubuntu.88161/

nitish_mythology
nitish_mythology Original post #1
May 18, 2008 at 10:11 AM
I am coding in JCreator(Windows) and now I want to execute the class file in Linux..
Dont know exactly if I have jdk or jre insatlled..

Here is the output of java -version

nitish@Nitish:~$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 (Ubuntu 4.1.2-0ubuntu5)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


This is what i did to execute the java ByteCode

nitish@Nitish:~/Development$ java linear
Exception in thread "main" java.lang.ClassFormatError: linear (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.70)
at java.lang.ClassLoader.defineClass(libgcj.so.70)
at java.security.SecureClassLoader.defineClass(libgcj.so.70)
at java.net.URLClassLoader.findClass(libgcj.so.70)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at gnu.java.lang.MainThread.run(libgcj.so.70)

Do i need to secify path?? I am already working in the directory that contains the class file.


PS:I hope the section is correct! Mayb it shd have been in Open Source!
QwertyManiac
May 18, 2008 at 10:15 AM
I do not know about the problem, but its better if you use Sun Java JDK 6 than GCJ (GNU tools).
nitish_mythology
May 18, 2008 at 10:26 AM
I have exceeded my monthly Bandwidth usage so I dont want to download anything right now..will have to wait till June!
Quiz_Master
May 18, 2008 at 10:59 AM
Or work in Netbeans (with JDK installed).... If you don't get enough bandwidth to download you can order a free DVD too from Netbeans.org
nitish_mythology
May 18, 2008 at 12:44 PM
Ya i have ordered it.. Seems I wll have to wait for a few days if I cant work on GCj.
Faun
Faun #6
May 18, 2008 at 1:31 PM
Or work in Netbeans (with JDK installed).... If you don't get enough bandwidth to download you can order a free DVD too from Netbeans.org

+1