aspose file tools*
The moose likes Beginning Java and the fly likes how to set path of java for win NT? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to set path of java for win NT?" Watch "how to set path of java for win NT?" New topic
Author

how to set path of java for win NT?

amit patel
Ranch Hand

Joined: Dec 02, 2001
Posts: 32
I have never installed java before and now when my company wants me to use java for one small application I realized that oh ' Oh god this is pain in ***'
anyway, come to the point:
I installed Java and also set class path as following (in autoexec.bat)
---------------
PATH:.c\Java\JRE\bin;
setCLASSPATH:.;c\Java\JRE\lib;
---------------
please note: this is at c:> promt ('edit autoexec.bat' command)
here as it sounds, C is drive, Java\JRE\bin and \lib is the path where both lib and bin folders are.
There one question that comes in my mind (I have one :confused that is it that c:> promt were I have to set this of at c:>java\JRE\ ?
I don't know.
I think there is very little pistack somewere but I can find it so I need expert help from you people
If you have any query or wants me to make clear any point please tell me.
Thanks
Amit
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Amit,
Are you just going to be running a Java app or coding one?
If you are just running Java apps all you need to do is d/l the JRE and install it. Don't recall having to set the path or class path.
If you are going to be compiling Java you need to d/l and install JSKD 1.3. It installs the JRE automatically. Then all you have to do is set your PATH to include the JSDK install directory i.e. PATH = .;c:\jdk1.3.1_01\bin;
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author Mike Meyers' Java 2 Certification Passport


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you are in WinNT you can maintain your parameters by going to the control panel, selecting System, then Environment and a panel with a bunch of parameters comes up for you to edit to your hearts content.
From Suns help

Windows NT
Double-click the System icon inside the Control Panel. When the System Properties dialog box opens, choose the Environment tab and then place the following in the lower list box, which is labeled "User Variables":
JAVA_HOME C:\JDK1.1.8
SWING_HOME C:\swing-1.1.1
CLASSPATH .;%JAVA_HOME%\lib\classes.zip;%SWING_HOME%\swing.jar
PATH %PATH%;%JAVA_HOME%\bin


"JavaRanch, where the deer and the Certified play" - David O'Meara
amit patel
Ranch Hand

Joined: Dec 02, 2001
Posts: 32
I think I have just installed JRE.
sorry if it sounds bit funny but 'do i have to install SDK?'
well it is for beginners so I can I ask this. right?
I got this CD from one book and I installed JRE (**not sure is that the one I want**) and then I check my drive there was bin and lib folders so I throught that java is installed (** tell me what to do**)
I will go to java.sun.com and will download SDK and istall it (** but I will wait for your reply**)
hold on, Do I have to check the JRE version and istall the same SDK ? or I uninstall that JRE(**the one I already have in computer**) and install SDK as you said SDK install also JRE.
I will leave it up to you. and yeah I do want to compile and all
thanks for your kind help
Amit
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you just want to run stuff then the JRE is enough. I have not a clue if that CD you used was smart enough to update your path and classpath parameters, so you should check them by hand.
If you actually want to compile stuff etc, then you need the JDK (or SDK as it is now called). I would suggest that you download SDK1.3 for whatever machine that you are using. Then double check to make sure that the parameters are OK. You can do this fairly easily by going to the DOS prompt and typing
>SET
A list of a bunch of stuff will spit out - including the current settings of your path and classpath.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
PS: The JDK/SDK downloads include a JRE bundled in with them.
amit patel
Ranch Hand

Joined: Dec 02, 2001
Posts: 32
ok, I got SDK. but now it makes one more question mark. I already have installed JRE and now when I will install SDK is it gonna over write JRE or will give me some new problem.
I love to come to this forum but it doesn't mean that I love 'errors' 'bugs'....
I want to be sure before doing any thing.
please help (...::...::...::...::...::...::...)
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Amit here is an easy way....
My Computer-->Right Click-->Properties-->Advanced-->Environment Variables. Then in Variable & Value pair write path & c:\jdk1.4\bin and then again a new variable classpath & C:\jdk1.4\lib

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
amit,
If you downloaded JDK/JSKD 1.3 it will install the JRE and set it as the default. It will not remove the old JRE or overwrite it unless it is exactly the same version.
Hope that helps.
amit patel
Ranch Hand

Joined: Dec 02, 2001
Posts: 32
God man !
you are great hero.
it worked and I am very grateful to you.
Thanks again
Amit
Originally posted by Ashik uzzaman:
Amit here is an easy way....
My Computer-->Right Click-->Properties-->Advanced-->Environment Variables. Then in Variable & Value pair write [b]path
& c:\jdk1.4\bin and then again a new variable classpath & C:\jdk1.4\lib

[/B]

amit patel
Ranch Hand

Joined: Dec 02, 2001
Posts: 32
Thanks guys. It becaue of you guys I finally set the PATH and it seems working but now I am getting following error message.
try to read it and tell me what to do.
Once again thanks for your kind help without you people it was not possible.
-========MESSAGE===========-
Here is the most simple program ever possible in java.
______________________________________________________________
class Q2
{
public static void main(String[] args)
{
System.out.println("God man !");
}
}
_______________________________________________________________

* I set the class path as follow:
PATH --> C:\jdk1.2.2\bin
CLASSPATH --> C:\jdk1.2.2\lib
then when I go to dos-promt and try (to test)
"D:\editplus\mices>javac Q2.java"
it works fine and gives me promt again (it ok so far)
and then I check files in mices folder and Q2.class file is there so the compiling part is over.
-_-
the problem comes from here
when I say
"D:\editplus\mices>java Q2"
it gives me this error:
"Exeption in thread "main" java.lang.NoClassDefFound Error: Q2"
I don't know whats went wrong !!! can I compile and run (at promt) from any directory or I have to store my files in some folder for which I set the path???
need help from you guys
Thanks
-=A=-

matt hooker
Ranch Hand

Joined: Jul 26, 2001
Posts: 46
Amit,
Your classpath should be :
C:\jdk1.2.2\lib;.
that ;. at the end is very important - it tells java to look in the 'current working directory' for .class files.
Hope this helps.


Its not what you do, its the way you say you've done it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to set path of java for win NT?