Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes setting up java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setting up java" Watch "setting up java" New topic
Author

setting up java

John Bushell
Greenhorn

Joined: Jun 12, 2002
Posts: 16
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?


thanks a bunch for your help<br />John
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
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


Greg Ostravich - SCPJ2
John Bushell
Greenhorn

Joined: Jun 12, 2002
Posts: 16
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
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
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?
John Bushell
Greenhorn

Joined: Jun 12, 2002
Posts: 16
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 ....
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
i'm also running on NT at work, and my CLASSPATH includes : e:\j2sdk1.4.0\lib\tools.jar
and path includes : e:\j2sdk1.4.0\bin
John Bushell
Greenhorn

Joined: Jun 12, 2002
Posts: 16
Hi Taariq
Have you any reference in your NT CLASSPATH variable to the classes.zip package?
cheers!, thanks for your reply
John Bushell
Greenhorn

Joined: Jun 12, 2002
Posts: 16
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 ......
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
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 ]
 
jQuery in Action, 2nd edition
 
subject: setting up java
 
Similar Threads
compilation problem
What's up with this DOS window?
Why can't I run these jar files on a PC that doesn't have the JRE 6?
ImageIO installer
rotating custom button, what paint method to ovveride