LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-08-2006, 10:22 AM   #1
sajith
Member
 
Registered: Sep 2005
Location: kannur
Posts: 59

Rep: Reputation: 15
java is not working


sir
i have a problem with java

my configuration is ubuntu 1.6

I wrote the sample java program

it prints just "Welcome to Java".

i compiled the program
$javac sample.java

it successfully compiled

when i run the program

$java sample

it will show the following error

java.lang.UnsupportedClassVersionError
at java.lang.VMClassLoader.nativeDefineClass (VMClassLoader.java)
at java.lang.VMClassLoader.defineClass (VMClassLoader.java:96)
at java.lang.ClassLoader.defineClass (ClassLoader.java:672)
at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:8
at java.net.URLClassLoader.findClass (URLClassLoader.java:833)
at java.lang.ClassLoader.loadClass (ClassLoader.java:359)
at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1282)
at java.lang.ClassLoader.loadClass (ClassLoader.java:303)
at java.lang.VirtualMachine.main (VirtualMachine.java:83)


how to fix this problem
 
Old 12-08-2006, 11:42 AM   #2
Linville79
Member
 
Registered: Nov 2006
Location: Indiana, U.S.A.
Distribution: Red Hat Enterprise Linux, Fedora, CentOS
Posts: 134

Rep: Reputation: 16
Make sure that the version of java that you compiled your source with is the same version of VM that you are trying to run it with.

You may need to updgrade your JVM to match the JDK version that you are using.
 
Old 12-08-2006, 01:36 PM   #3
ctkroeker
Senior Member
 
Registered: May 2005
Posts: 1,565
Blog Entries: 1

Rep: Reputation: 50
From http://ubuntuguide.org
Quote:
* Set Sun's JVM as default Java version:

sudo update-java-alternatives -s java-1.5.0-sun

* Edit /etc/jvm and move /usr/lib/jvm/java-1.5.0-sun to the top of JVMs offered:

gksudo gedit /etc/jvm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java/Firefox java plugin not working with HP Webjetadmin iamskykid Linux - Software 2 03-02-2006 02:38 PM
java working, java plugin not provkitir *BSD 3 01-12-2005 05:49 PM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM
Java not working bwaynej2002 Linux - Software 1 09-06-2003 12:25 AM
Java not working BriceM Linux - Software 5 08-15-2003 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration