In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you what are frequently asked questions about Java. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Q: how do I set the environment variable for Java 2 (JDK1.2)?
Answer: after Java 2 installation, you need to set the PATH and JAVA_HOME environment variables. Unlike JDK1.1, when the JAVA_HOME environment variable is set, JVM automatically searches the system class library and the user's current path.
The Java 2 environment variable is set as shown in the following example:
Solaris platform: the installation path of setenv JAVA_HOME Java2
Setenv PATH $JAVA_HOME/bin:$ {PATH}
Windows platform: the installation path of set JAVA_HOME=Java2
Set PATH=$JAVA_HOMEbin;%PATH%
Q: which Java integrated development tools support Java 2?
A: popular Java integrated development environments, such as Inprise's JBuilder,Symantec Visual Cafe and Sybase's PowerJ, support Java 2. 0.
Q: if an error occurs running Java applet in a Netscape or IE browser, how do I determine the scope of the error?
Answer: when java applet is running in a browser, the default JVM of the browser itself is used. And different browsers have different levels of support for JDK. Therefore, there is an error in running Java applet in a Netscape or IE browser. It is recommended to use appletviewer, a tool provided by JDK, or Hotjava browser of Sun to test the applet to make sure that the error is browser-related.
If applet runs well in appletviewer or Hotjava, the error occurs because the browser is not fully compatible with JDK. At this point, the solution can be to use a Hotjava browser or install Sun's Java Plugin.
If an error occurs when applet is running in a Hotjava browser or appletviewer, you should check the applet program according to the error prompt.
Q: why do Chinese characters sometimes appear garbled when inserting data into or extracting data from a database using JDBC?
Answer: the implementation of this problem is usually related to the implementation of each JDBC driver. At present, most JDBC driver use local coding format to transmit Chinese characters. For example, Chinese characters "0x4175" will be converted to "0x41" and "0x75" for transmission. So we need to convert the characters returned by JDBC driver and the characters to be sent to JDBC driver.
When inserting data into the database with JDBC driver, you need to convert Unicode to native code; first. When JDBC driver queries data from the database, you need to convert native code into Unicode. The following is the implementation of these two transformations:
String native2Unicode (String s) {
If (s = = null | | s.length () = = 0) {
Return null
}
Byte [] buffer = new byte [s.length ()]
For (int I = 0; I s.length (); iTunes +) {if (s.charAt (I) > = 0x100) {
C = s.charAt (I)
Byte [] buf = ("" + c) .getBytes ()
Buffer [jacks +] = (char) buf [0]
Buffer [jacks +] = (char) buf [1]
}
Else {
Buffer [jacks +] = s.charAt (I)
}
}
Return new String (buffer, 0, j)
}
Thank you for reading! This is the end of this article on "what are the common questions about Java?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.