PDA

View Full Version : Java Classpaths



siDDis
March 22nd, 2005, 08:32 PM
I have a problem setting classpath with java in Linux, I have a jar file but have no idea where I should place it.
So I made a /usr/java/classes folder where I put it and wrote #export CLASSPATH=${CLASSPATH}:/usr/java/classes/easyio.jar

This worked, but now I messed it up so I lost the classpath to the default packages.

How can I fix this?

I think I use sablevm to run the java enviroment, I have no idea why not the default java environment was installed.

kirk
March 23rd, 2005, 06:33 PM
Maybe you could just try to set it yourself, e.g. in /etc/profile or something. You could find out the path with
locate .jar | grep jre
or
locate .jar | grep sablevm

Trial and error might work in this case ;)

defkewl
March 24th, 2005, 07:55 AM
Maybe you could just try to set it yourself, e.g. in /etc/profile or something. You could find out the path with
locate .jar | grep jre
or
locate .jar | grep sablevm

Trial and error might work in this case ;)
Or in /home/your_home/.bash_profile

siDDis
March 25th, 2005, 03:02 PM
thanks,
but where do I find the default java classes?

cow_racer
March 25th, 2005, 04:47 PM
There is no default class path.

siDDis
March 28th, 2005, 02:35 AM
thats weird, because when I run a java program I get this error message

olav@siddunix:~/Desktop/Programmering$ java Bank
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:88)
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)