Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI 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 December 7th, 2004, 10:02 PM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default classpath?

what the function to set classpath?

in dos, i try use javac but this dont recoqnize the command.



 
Old December 8th, 2004, 04:44 PM
Authorized User
 
Join Date: Nov 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sonicDace Send a message via MSN to sonicDace Send a message via Yahoo to sonicDace
Default

Hi, abdi

The two most commonly used environment variables are PATH and CLASSPATH

When you code in java, you want do do at least 2 things: Compile the code and Run the code

COMPILING THE CODE
when you type "javac", it looks up your PATH variable to try to find where (in what folder) javac.exe is located. So if your javac.exe file is in "c:\Program Files\j2sdk1.5\javac.exe" and your PATH variable isn't defined as a System variable, then you'll have to type the whole "c:\Program Files\j2sdk1.5\javac.exe MyClass.java".

java, javac, jar and a whole bunch of others are typically looked up using the PATH variable.

RUNNING THE APP
when in the command prompt you type "java MyClass", it will look for the PATH to find "java.exe" and then it'll look in the CLASSPATH to find MyClass.class

If CLASSPATH is not defined, then you'll have to type it in the command line using the -cp argument or it won't know where to find the class and give you a big NoClassDefinedError (At leas I think thats what the error is)

Hope this helps





Similar Threads
Thread Thread Starter Forum Replies Last Post
classpath ekta BOOK: Beginning Java 2 1 March 28th, 2005 11:35 PM
chapter1 CLASSPATH jeanne JSP Basics 2 August 11th, 2004 12:45 AM
setting classpath aadz5 JSP Basics 1 July 28th, 2004 04:04 PM
how to set the classpath sxj1209 JSP Basics 3 March 29th, 2004 04:36 PM





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