Welcome! Log In Create A New Profile

Advanced

Java & jGrasp installation

Posted by colinp 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Java & jGrasp installation
February 12, 2008 06:54AM
I installed Java and jGrasp from the CD in the textbook, ran the first tutorial example, and instead of getting "Hello world" got a string of error messages:

----jGRASP exec: java Hello

java.lang.UnsupportedClassVersionError: Hello (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.

My guess is that jGrasp is not seeing Java correctly. I am running Win XP SP2. Any ideas how to correct this?

Thanks
Colin
Re: Java & jGrasp installation
February 12, 2008 11:11AM
Hi Colin

I just downloaded the latest version from http://www.jgrasp.org/ and it all worked 100%. Its version 1.8.6_05.

What do you get when you enter: java -version

I get the following:

java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

Maybe your java version is too old - just guessing here.
Re: Java & jGrasp installation
February 12, 2008 12:54PM
I get the following:

java version "1.5.0"
Java(TM) 2 Runtime Environment Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

This is an older version clearly, but as it all came with the CD I expected it to all work well together. Also, I have since tried installing it onto another (virtually identical) computer, and all seems okay. Who knows?

Thanks.
Colin
Re: Java & jGrasp installation
February 12, 2008 01:04PM
The only other thing I can think of is that the CLASSPATH environment variable may be altered on your PC by some other application that was installed that uses Java. Try running your programs at the command prompt. You must be in the directory of where your .class file is.

First try: java Hello

If that works, then ignore this post smile

If you get errors then try:

java -cp . Hello (there is a space either side of the full stop)

If that does work then the CLASSPATH is pointing to some other library.

This is all speculation here.

Hope you come right.
cheers
Mathew
Re: Java & jGrasp installation
February 13, 2008 04:06PM
Hi Mathew

I tried both "java Hello" and "java -cp . Hello" and got the same set of errors. Maybe it is the classpath that is wrong, but how to I go about correcting it?

Ciao
Colin
Re: Java & jGrasp installation
February 13, 2008 04:10PM
what do you get when you enter:

C:\>echo %CLASSPATH%
Sorry, only registered users may post in this forum.

Click here to login