eova1.6 运行在eclipse 2022

elipse导入项目后 修改pom.xml  jdk.version 改为1.8 增加(因为内置的依赖太旧) <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.15</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.23</version> </dependency> 数据库连接增加?serverTimezone=UTC   增加后如下,必须放在?后面第一个 main.url = jdbc:mysql://127.0.0.1:3306/demo?serverTimezone=UTC&useSSL=false&  

安装MySQL

8 安装MySQL cd ~ wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm rpm -ivh mysql57-community-release-el7-9.noarch.rpm cd /etc/yum.repos.d/ yum install mysql-server #启动 systemctl enable mysqld systemctl start mysqld vi /etc/my.cnf 在 [mysqld]最后加上 skip-grant-tables(手敲) service mysqld restart mysql -uroot -p 回车 >use mysql; update user set authentication_string=password(‘密码’) where user=’root’; 修改回原来配置, 再次登陆后,再改一次密码 mysql -uroot -p我的密码 alter user user() identified by ‘密码’; 开放局域网访问: use mysql; … Read more

ECLIPSE设置全局编码为UTF-8的方法

如果要使插件开发应用能有更好的国际化支持,能够最大程度的支持中文输出,则最好使 Java文件使用UTF-8编码。然而,Eclipse工作空间(workspace)的缺省字符编码是操作系统缺省的编码,简体中文操作系统 (Windows XP、Windows 2000简体中文)的缺省编码是GB18030,在此工作空间中建立的工程编码是GB18030,工程中建立的java文件也是GB18030。 如果要使新建立工程、java文件直接使UTF-8则需要做以下工作: 1、windows->Preferences…打开”首选项”对话框,左侧导航树,导航到general->Workspace,右侧Text file encoding,选择Other,改变为UTF-8,以后新建立工程其属性对话框中的Text file encoding即为UTF-8。 2、windows->Preferences…打开”首选项”对话框,左侧导航树,导航到general->Content Types,右侧Context Types树,点开Text中每一个子项,并将其编码设置为”UTF-8″,点update! 其他java应用开发相关的文件如:properties、XML等已经由Eclipse缺省指定,分别为ISO8859-1,UTF-8,如开发中确需改变编码格式则可以在此指定。 3、window–>preference–>MyEclipse–>Files and Editors,将每个子项的”Encoding”改为”ISO 10645/Unicode(UTF-8)”,点Apply! 4、经过上述三步,新建java文件即为UTF-8编码,Eclipse编译、运行、调试都没问题,但是做RCP应用的Product输出时、或者插件输出时,则总是出错,要么不能编译通过(输出时要重新compile)、要么输出的插件运行时中文显示乱码。此时需要再RCP应用、或插件Plugin工程的build.properties中增加一行,javacDefaultEncoding.. = UTF-8。让输出时编译知道java源文件时UTF-8编码。这个设置需要保证所有的java源文件时UTF-8编码格式,如果不全是,可以参考 Eclipse帮中(Plug-in Development Environment Guide > Reference > Feature and Plug-in Build configuration),建议全部java源文件是UTF-8编码。 如果插件开发、RCP应用开发原来基于其他编码,如GB18030,想转换为UTF-8,则首先,做以上工作;然后通过查找编码转换工具,如基于 iconv的批量转换工具,将原编码转换

[Java]apache commons

1、IOUtils org.apache.commons.io.IOUtils,操作 IO 流的工具类,下面是其常用的方法。 //1.读取Stream IOUtils.toString( InputStream ) //2. 关闭流 IOUtils.closeQuietly(in); //3. 写入到流 IOUtils.write(“沉默王二”, response.getOutputStream(), “UTF-8”); 2、FileUtils org.apache.commons.io.FileUtils,操作文件或者目录的工具类 //1. 读取文件 List lines = FileUtils.readLines(file, “UTF-8”); //2. 删除目录 FileUtils.deleteDirectory(file); //3. 读取文件 String str = FileUtils.readFileToString(file); //4. 文件复制 FileUtils.copyFile(source, dest); //5. 写入文件 FileUtils.writeStringToFile(file, txt, Charset.forName(“utf-8”)) //6. 强制删除文件或者目录及其所有子目录和文件 FileUtils.forceDelete(tmpFile); 3、BeanUtils //1. 克隆对象 Person person2 = (Person)BeanUtils.cloneBean(person); //2. 将一个Map对象转化为一个Bean … Read more

centos7安装JDK8

centos7 安装JDK8 下载 jdk-8u201-linux-x64.tar.gz tar -zxvf jdk-8u201-linux-x64.tar.gz mv jdk1.8.0_201/ /usr/local ln -s /usr/local/jdk1.8.0_201/ /usr/local/jdk ln -s /usr/local/jdk1.8.0_201/ /usr/local/java 添加环境变量 vi /etc/profile export JAVA_HOME=/usr/local/java export PATH=$JAVA_HOME/bin:$PATH source /etc/profile 验证 java -version

windows11 恢复win10 右键菜单

右键win菜单,点击windows终端(管理员),执行 reg.exe add “HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32” /f /ve 重启 想要回滚 reg.exe delete “HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32” /va /f

mysql指定ip访问

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ IDENTIFIED BY ‘password’ WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO ‘root’@’192.168.1.204’ IDENTIFIED BY ‘password’ WITH GRANT OPTION; flush privileges; select * from user; 如果是更新 update user set host =’192.168.1.2′ where user = ‘root’ and Host=’localhost’;

FtpConfig.java

package FTPDemo; /** * @date 2016年12月30日 * @author xie * */ public class FtpConfig { // 主机ip private String FtpHost; // 端口号 private Integer FtpPort; // ftp用户名 private String FtpUser; // ftp密码 private String FtpPassword; // ftp中的目录 private String FtpPath; public String getFtpHost() { return FtpHost; } public Integer getFtpPort() { return FtpPort; } public … Read more