Simple one I hope. I have a company wide JRE installed on a win NT platform. The JRE is donkeys years old (1.1.5), and I want to use the latest JDK. I don't have admin rights to the NT session, but was hoping to set up an environment to compile/run programs. I have downloaded the latest JDK and installed this successfully. The contents of the install did not have a classes.zip file and when I compile my code I keep getting java.lang.xxxxx error messages. I was assuming this is because the classes.zip file is very old? Does anyone know why I do not get this file when downloading the SDK?
John, What have you set-up so far as far as your JDK is concerned? Have you just downloaded and unzipped the JDK? Have you also set your CLASSPATH? Do you at least have enough privileges to modify your environment variables? If not, you may want to set up a batch file that does your compiles and/or runs and sets up the CLASSPATH within it. Another option is to download Ant from the Apache Jakarta project and create a build file. You might still need to set-up a batch file for that too just to set the CLASSPATH variable and to adjust your PATH so Ant can be found. If you don't over-ride your CLASSPATH you might be referring to the ancient JVM (v 1.5.5) you were referring to instead of the new one you downloaded. There's my $.02 - Greg
Thanks for the reply Greg. I have tried modifying the CLASSPATH, but this does not seem to resolve my problem. When I compile using the full path where my javac executable exists, the class compiles fine, but when I try to run it using a wide range of methods (classpath changing, full path specifying, etc) it spits at me complaining that it is unable to initialise threads, and cannot find java/lang/thread. Not too sure what's going on as when I compile using -verbose option, it finds these classes without a problem! I'm stumped
It still could be a CLASSPATH issue. Your ability to compile since you fully qualified the javac doesn't negate the fact that at run time the JVM couldn't find and load the class it needed (Thread) for this program. What does your classpath look like? Can you include it in your next post? Do you set it in your ENVIRONMENT through the Control Panel? Or just during a session (DOS Window) you're working with?
Hi Greg, thanks for the response, please find info below : >What does your classpath look like? I installed the JSE 1.4 yesterday (as administrator), this still didn't resolve the issue though. My classpath is set to : C:\j2sdk1.4.0_01\lib\classes.zip;C:\j2sdk1.4.0_01\bin;C:\jdk1.1.5\lib\classes.zip >Do you set it in your ENVIRONMENT through the Control Panel? Or just during a session (DOS Window) you're working with? I have tried both ways without any luck (e.g. In DOS I try c:\blahblah\java -classpath c:\blahblah <java class name> I still keep getting the same error message. One thing I have noticed is that in a previous install (old 1.1 Java), the classes.zip file exists in the 'lib' sub directory, but in the 'lib' directory of the new sdk there is no such zip file. Would you know if SUN have changed this file in the new releases or have they re-packaged the zip file as a jar? cheers Greg and ....
Chaps, managed to sort it. I have just made sure the xxxxx\bin dir path was at the beginning of the classpath list. I am still not sure what happened to the classes.zip file in the newer versions of Java2, but at least it works now! thanks for your help. I am relatively new to Javaranch, but participate in HP's forum (where points are assigned in exchange for anwers to particular questions), do I assign points to people here as well? ta ... oh and ......
Congrats! I'm glad you got it to work. I don't specify the JDK jars in my classpath, I just refer to the directories. Mine also includes some other tools I use (JUnit, SQL Server JDBC drivers, Xalan for XML stuff, etc). Here's mine:
I also admit mine might be too inclusive - but it works for me. [ August 29, 2002: Message edited by: Greg Ostravich ]
Greg Ostravich - SCPJ2
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad: