1.3 begins with programs, but ... I still don't know how to download after downloading. There is only one "java web start" in the start menu, and it will not be used online. Where is the programming environment? ? ? I am really a fog. I checked it on Google, finding articles as follows:
How to configure JDK2004-03-05 in Win2K, click: 1368
How to configure JDK under Win2k
How to configure JDKHELLOWORLD @ {pjlc} by Nyra@sohu.com 2002-8-26 Ver 1.0 public published under Win2k, in http://www.java.com.cn/ Suitable for Win2K / XP platform, J2SDK SE1.4 The above, there is a certain reference significance for J2SDK se1.3.x! {改 Adaptation: How to configure jdkhelloworld @ {pjlc} by nyra@sohu.com 2002-6-5 ver 0.5}} 1 in Win9X: JDK JDK is an abbreviation of Java Develop Kit. It is an early Java development package name. It has been extended to this day! When JDK issued a version 1.2 in 1998, Sun used the new name Java 2 Platform to call Java to translate into Chinese. " Java Platform, modified JDK called J2SDK, Java 2 (Platform) Software, and divided into standard Edition, also known as J2SE, Enterprise Edition, also known as J2EE, microReition) J2ME. It has different purposes, but the most basic development kit is also the latest version of JDK's latest version of JDK, can be downloaded in java.sun.com, until 2002-6-5, J2SE is released to 1.4.0. In Win32 (WIN9X or WINNT2000XP), there is English and international version (International), the international version of the tool has a Chinese tip! The download address of JDK is a 1.4 version httpjava.sun.comj2se1.4download.html version 1.3 httpjava.sun.comj2se1. 3Download.html does not recommend 1.2 previous versions unless you have special requirements! This document is used in this document using J2SE 1.4 English version 1.3 Install J2SDK JDK downloaded from Sun download is an executable file, about 30 megabits, direct execution can. Note that it requires an installation directory, which is jdk1.x.x by default! This directory is modified! For convenience, here, it is assumed to be installed in the D: // J2SDKSE14 directory. Finally, JDK automatically installs a Java runtime enveronment (Java Runtime Enveronment) in c: // program files // javasoft ... don't make it with the JDK directory above! 2. JDK Detailed 2.1 JDK virtual machine JDK is divided into Two parts, one is the Java runtime environment mentioned above, and the other is the development environment. They have a java virtual machine that has a JRE directory in the directory of the Java runtime environment and development environment, respectively, which is the real Java virtual machine! The virtual machine of the Java runtime environment is: C: // Program Files // javasoft ... // JRE 1.4 version may be: c: // program files // java // j2re1.4.0 java development environment Virtual machine in: D: // J2SDK // SE14 // JRE There are many Java.exe executables in the Windows environment, which ultimately they call virtual machines that call the above two! Select the virtual machine to use the Java Plug-in, the Java Rutime Environment menu in the Advanced tab on the Senior tab. Use the virtual machine of the Java runtime environment when you value.
This two virtual machines installed in the same JDK basically no difference! 2.2 Executable files Java.exe and JavaC.exe Selection These two tools are used to perform Java programs and compile Java programs! Machines with JDK There are multiple Java and Javac files! We can choose to use a Java.exe or JavaC.exe file by setting the environment variable PATH! Multiple versions of java.exe and javac.exe cannot be universal, or you can't modify the location! That is to say when Java.exe under the Windows directory is moved to the JDK installation directory, it may not be executed (early Java.exe is like this, there is no such statement after 1.3, everyone can try it, 1.3 It seems to get the location of the virtual machine through the registry, not a relative path!). It is recommended to use java.exe under the c: // j2sdk // se14 // bin directory, this is a habit, there is no necessary reason! At this time, PATH can be set to Path = C: // J2SDK // SE14 // bin ;% PATH%, pay attention to the Windows directory there is also a java.exe !! This means that even if you do not set PATH, you can execute the Java program! In the PATH variable, the higher the executable of the directory will have the higher priority. Execution! Also, when there is file C.exe in directory A and Directory B, if a in Path A is in B, the C.EXE under the A directory is executed instead of B // C.EXE {{Win2k} } The method of modifying the environment variable is different from Win9x under Window 2000 and XP. Under Win2K / XP, right-click on my computer, select [Properties], select [Advanced] in the pop-up dialog box, you can see that there is a [Environment Variable] button at the bottom of this page, click it, The environment variable modification dialog will pop up.
All environment variables are modified here: including Path and ClassPath. {{Win2K}} 2.3 Class Path ClassPath This is an old problem, and no longer need classpath after 1.2 to set the path of the system class! ClassPath is to set the user Class or third-party library set! This is used when .CLASS is executed, the current directory is any! java -cp x: / pathto / class helloWorld -cp is the same as ClassPath, setting the environment variable ClassPath effect is the same! You can also use compressed files in ClassPath, such as ZIP Or jar. If the user puts helloworld.class into some.jar files! Java -cp x: /pathto/some.jar HelloWorld When mixing multiple directory or JAR files, Java virtual machines perform the first found Class! Java -cp x: / pathto / classes; x: /pathto/some.jar HelloWorld will not perform HelloWorld.class2.4 compile helloWorld.java2.4.1 compilation (public bag) Java program The content of HelloWorld.java is as follows: This is not used here! // package nyra.pljc.helloworld.win9x; public class helloWorld {public static void main (string [] argv) {system.out.println (Hello, World!) }} Note Java is case sensitive, please pay attention to the case where you don't pay attention to the case! HelloWorld/helloWorld.java, pay attention to the file name, and the classes that apply to public can only be saved in the same name file (case in case )! Compile, current directory is any! Javac -sourcePath x: / mywork helloworld.java Note SourcePath is the source file directory! You should use ClassPath when you need to reference other classes (. Class) (not easy to write CP) as follows: javac -sourcepath x: / mywork -classpath x: / 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子, this is the following: Note that the package is as follows: Note that the package! Public class helloworld {public static void main (string [] argv) {system.out.println (Hello, World!);}} Note Java is case sensitive, please pay attention to case error! HelloWorld is saved in x: / In MyWork / HelloWorld.java, pay attention to the file name, and the classes that have been applauded for public can only be saved in the same name file (case in cases)! Source files do not have to be saved under the package directory (NYRA / PLJC / HELLOWORLD / WIN9X)! Compile The current directory is arbitrary! Javac -SourcePath x: / mywork -d. Helloworld.java Note -d. Refers to generating a package directory and class file in the current directory, if not specified -D, generate HelloWorld in the current directory. Class, executing Java HelloWorld here will prompt this class because there is no package directory.
So you must use -d to generate a class file in the original file directory (x: / mywork), use -d x: /mywork2.4.3 Compilation file lookup order When you need class StrangeClass, Java will look up StrangeClass.class file Java program first Check the Bootstrap core class, if there is no target check the extension class directory, and its directory's JAR file (this directory in the virtual machine directory jre / lib / ext), if you do not check the directory specified by the classpath and the JAR file, if there is no {{ {不}}} Check the current directory! If Javac is executed, if it is java.exe directly prompts that there is no class! Check if there is a source file if you need a class source file. If you have to compile it, if you don't check the list of compilation files, there is no need for a source file, if you have it, if you have it, if you don't prompt the lack of class! 3. The FQA part from the BBS Shuimu Tsinghua Station SMTH.org Forum error 1: "Javac 'is not internal or external command, nor can be running programs or batch files. (Javac Command Not Found) is not set Good environment variable Path.Win98 Add Path =% path% in AutoExce.bat; c: /jdk1.2/bin, then under the control panel - System - Advanced - Environment Variable - System Variables ... Double click? Path, add C: /jdk1.2bin. Of course, we assume that JDK is installed in a c: /jdk1.2 directory (a little Tang Yan?) ... It seems to restart the system to work ... (Know ! Tomatoes) Ok, try again! Javac HelloWorld Error 2: HelloWorld Is An Invalid Option or Argument. Please give some professionalism, Java's source program is necessary to save .java file, and compile .java. OK, Javac HelloWorld.java (this time should I become?) Error 3: HelloWorld.java1 Public Class HelloWorld Must Be defined in a file caledHelloWorld.java.public class helloworld {^ This problem is because The name of your class is inconsistent with the name of the file. (Who said, clearly seeing that people have such a writable) OK, accurately say, a Java source program can define multiple classes, however, classes with public properties There can only be one, and it is to be consistent with the file name. Also, the main method must put in this public class, so that Java (run) this class. Another thing is that the Java language is strictly sized strictly. Beginners should pay attention.
Like the above case, helloWorld and HelloWorld think it is different, so ... oh ... good, change, 嘻 ... ... javac helloworld.java ... (咦, what is there?) Faint This is the compilation. See if you have a HelloWorld.class (Hehe .. pressing the book) Java HelloWorld (!! I know, not java helloWorld.class 哟) Error 4: Exception in thread main java.lang.noclassdeffounderror helloworld huh , This is the famous classpath problem. In fact, class paths are the concepts in Java involved in the compilation process. ClassPath is to specify where to find the class, it is as simple as it is. Since our HelloWorld is not used in other (non-java.lang package) classes, there is no encounter when compiling. When running, you have to indicate where your class is. Solution, you can run: java -classpath. HelloWorld "." The current directory can be used. Of course, this is a bit trouble (it is "too much trouble"!), We can set the default classpath in the environment variable. Methods are set by the above settings. Set ClassPath = .; cjdk1.2libdt.jar; CJDK1.2LibTools.jar The two suggestions behind it are also available in the future. Java-ClassPath. HelloWorld (I don't want to learn Java again) Error 5: Exception in thread main java.lang.nosuchmethodError main (咣) Don't, stick to it. Look at your code, the problem is in the definition of the main method, write it to the place, is it written? Public static void main (string args []) {One word should not be poor, don't ask why. .., including uppercase! Java-ClassPath. HelloWorld (listening to the heavens!) Hello World! (FAINT! Finally ...) Ok, now the task is to study this article.