|
|||||||
| Java (NOT JavaScript!) For discussion of the Java programming language as it applies to the Web ( Not JavaScript ). |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Set Enviroment Variables
HI all:
I installed jdk1.5.0_09 in my C:\Java\jdk1.5.0_09. Then I go to Enviroment Variables I set a PATH. C:\Java\jdk1.5.0_09\bin am I doing it right? -------------------------------------------------------------- Below is DOS promt. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Owner>cd C:\Java C:\Java>java Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -client to select the "client" VM -server to select the "server" VM -hotspot is a synonym for the "client" VM [deprecated] The default VM is client. -cp <class search path of directories and zip/jar files> -classpath <class search path of directories and zip/jar files> A ; separated list of directories, JAR archives, and ZIP archives to search for class files. -D<name>=<value> set a system property -verbose[:class|gc|jni] enable verbose output -version print product version and exit -version:<value> require the specified version to run -showversion print product version and continue -jre-restrict-search | -jre-no-restrict-search include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:<packagename>...|:<classname>] -enableassertions[:<packagename>...|:<classname>] enable assertions -da[:<packagename>...|:<classname>] -disableassertions[:<packagename>...|:<classname>] disable assertions -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:<libname>[=<options>] load native agent library <libname>, e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:<pathname>[=<options>] load native agent library by full pathname -javaagent:<jarpath>[=<options>] load Java programming language agent, see java.lang.instrument C:\Java>version 'version' is not recognized as an internal or external command, operable program or batch file. C:\Java>java -version java version "1.5.0_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03) Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing) C:\Java>java HelloWorld Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld C:\Java>HelloWorld.java C:\Java>java HelloWorld Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld C:\Java> Last edited by smallstone; 11-11-2006 at 09:19 AM. |
|
#2
|
||||
|
||||
|
Did you compile it first?
__________________
Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter celery is tasteless - currently needing some UI time |
|
#3
|
|||
|
|||
|
I have no idea to run the sample file. what is the command to compile? can you show me? thanks.
|
|
#4
|
||||
|
||||
|
from your jdk, you have to run javac, which is the java compiler. it should be in that bin directory.
__________________
Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter celery is tasteless - currently needing some UI time |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|