Java starts, environmental configuration

xiaoxiao2021-03-06  40

I remember that when I first did Java, the configuration environment actually used a week, which may be my very benzene. Of course, there are too many information on this configuration. I can refer to what places may be more mistakes here, causing beginners. Welcome everyone to keep up and point out my mistakes. 1, JDK download and classpath settings Now the highest version of JDK has reached 1.4.2, and there is a installation wizard prompt installation, in fact you decompress the copy of the JDK folder, it is also possible. The key is the configuration of CLASSPATH. My machine is Win2000, my classpath is: d: /workshop/javalib/jfreechart-0.9.14/jfreechart-0.9.14.jar; d: /workshop/javalib/jcommon-0.8.9/jcommon-0.8.9 .jar; d: /prgandsoft/jdkandtomcat/j2sdk1.4.1/lib/tools.jar; d: /prgandsoft/jdkandtomcat/j2sdk1.4.1/lib/dt.jar; d: /workshop/javalib/jdbcforsqlser/msbase.jar; D: /workshop/javalib/jdbcforsqlser/msqlser.jar; d: /workshop/javalib/jdbcforsqlser/msutil.jar; Is it very long? That's because I used some other packages, at least after I installed JDK, your classpath should contain dt.jar and Tools.jar, pay attention, must be added ";", and must be In the English state. In general, you can write and run the classic "HelloWorld" program. Sometimes, you may speak, I have included it in these two files, why is it wrong? Then you have to check, if you have other packages in your classpath, if those packets have an error, then your entire classpath is invalid. I have encountered this situation. 2: The setting of Path Some friends will change to DOS mode, open the javac command, will prompt the error. Then you have to set your path. My path is: d: / prgandsoft / microsoft visual studio / common / tools / winnt; d: / prgandsoft / microsoft visual studio / common / msdev98 / bin; d: / prgandsoft / microsoft Visual Studio / Common / Tools; D: / prgandsoft / microsoft visual studio / vc98 / bin; d: /prgandsoft/jdkandtomcat/j2sdk1.4.1/bin pay attention, here my last one is my Java directory Path, note that there is no need to ";"; " The above two variables are set, then you will not encounter the error like Exception in Thread "Main" java.lang.noclassdeffounderror: Exam13. Another point needs to be reminded, that is, it is useful to log out of the machine after ClassPath and Path, which is useful.

转载请注明原文地址:https://www.9cbs.com/read-74782.html

New Post(0)