Wrox Programmer Forums
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2004, 05:53 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Class path setting

Hello every body
Can someone explain me how to set the classpath because I don´t know how to do it and I already tried learning from the documentation but it´s confusing. So please i think everyone here knows how to do it, if you explain it without sending me to read the SDK documentation, reply this post.
Thanks so much :)
 
Old July 15th, 2004, 08:25 PM
Authorized User
 
Join Date: Jul 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yuji_chen
Default

This question is come around n around, I think u can search the forum for that. There is plenty of good explaination in there. Good Luck

 
Old July 16th, 2004, 09:13 AM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I was the one who asked a while ago but I am still stucked, and there is no other post asking this question, if you arent answering my question, please, don´t reply.
 
Old July 19th, 2004, 03:52 PM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pedr0
 No, I was the one who asked a while ago but I am still stucked, and there is no other post asking this question, if you arent answering my question, please, don´t reply.
Hello again Pedro, I remember you, you are on the Windows XP platform.
You want to set the classpath, so you can always compile and run your java classes from the MS-DOS prompt. Then the path to the bin directory where the SDK tools javac and java reside will be automatically known to the system.
This is not impossible, but you have to follow my instructions STEP by STEP.

I follow the same steps here and now on my girlfriend's computer, which is a Dutch Windows XP professional. I will supply an English version of all the links I click, while I read the documentation at:
http://java.sun.com/j2se/1.4.2/install-windows.html
and:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/tools.html
http://java.sun.com/j2se/1.4.2/docs/...classpath.html

Follow me in my steps carefully:

0. write down the full name of the path where you installed the SDK bin, FOR EXAMPLE:
      C:\j2sdk1.4.2_1\bin;
NOTE: end with ;
If you haven´t installed the 1.4.2 SDK yet, visit:
http://java.sun.com/j2se/1.4.2/download.html
You can do yourself a big favor to also install the API DOCS documentation and the source files!
1. write down (or print) these instructions first
2. bottom left: open Start
3. middle: Control Panel (Dutch name is "configuration screen")
4. top left: Classic display
5. double-click icon: System
6. top: advanced tab
7. bottom: Environment Variables
8. look for the variable Path in System Variables (or User Variables)
9. click at the bottom the "edit" function
10. the current path values should be maintained, not deleted,
type in the path to the SDK bin AFTER the system path names,
but make sure it is placed BEFORE any other Java bin already there
11. OK, OK, OK
12. restart, ready!

BUT?

If it still does not work, the first Sun webpage I mentioned might be wrong. Decide this must be so after trying hard to get it working. Then you must use the same procedure with a CLASSPATH variable:

It could be that instead of the Path you should set the CLASSPATH variable to point to the bin. Sometimes java programs set their classpath there.
By now you will know how to set it (remember to place the path before any other Java paths)

- First be tidy and remove the old reference in Path.
- Check if the CLASSPATH is available in System Variables (step 8),
if it is not there you can create a new CLASSPATH variable:
- bottom click new
- enter name of variable: CLASSPATH
- enter value of variable: the path to the SDK bin
- OK, OK, etcetera

P.S. Please be so kind to write me here with which method you succeeded in getting the javac compiler and java application to run smoothly!
With the Path or the CLASSPATH variable??
 
Old July 22nd, 2004, 07:23 AM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gooooooot it, finally I set the path in enviroment variables (nothing about classpath, just path) I compiled the code, I got the class file and finally this thing works, thank you really much.
 
Old July 26th, 2004, 03:36 PM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Originally posted by pedr0
I set the Path in environment variables (nothing about CLASSPATH, just Path) I compiled the code, I got the class file and finally this thing works, thank you really much.

Francis says:
"Thank you Pedro, you proved there are two ways to set the classpath permanently. I didn't tell you in that many words, but I had my doubts about setting it in the Path environment variable. I would have thought CLASSPATH was the better option."

And GOOD LUCK with learning Java! I think Ivor Horton wrote the best book for beginners (like you and me).

Francis @ ch15
& learning JavaScript in the holidays










Similar Threads
Thread Thread Starter Forum Replies Last Post
PATH Setting of tomacat in linux annumol Apache Tomcat 3 December 24th, 2007 12:16 AM
Error while setting class path sujithmathew Linux 1 August 3rd, 2007 01:02 PM
Setting up the path and classpath Yvette Java Basics 0 December 14th, 2005 10:13 PM
Problem in setting java.library.path kuldeept Apache Tomcat 0 March 22nd, 2005 03:50 AM
Setting path to local "C" drive for crystal report rajupusapati Crystal Reports 2 June 17th, 2004 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.