顯示具有 Eclipse 標籤的文章。 顯示所有文章
顯示具有 Eclipse 標籤的文章。 顯示所有文章

2022年11月25日 星期五

JAVA Remove Console escape Ansi log char

 

JAVA Remove Console escape Ansi log char


String tmp.replaceAll("\u001B\\[[;\\d]*m", "");

2022年7月6日 星期三

Eclipse 佈景主題還原

 

Eclipse 佈景主題還原

rename folder

D:\workspace-spring-tool-suite-4-4.12.1.RELEASE\.metadata\.plugins\org.eclipse.core.runtime\.settings

D:\workspace-spring-tool-suite-4-4.12.1.RELEASE\.metadata\.plugins\org.eclipse.core.runtime\_.settings

2021年12月22日 星期三

Maven repository

 Maven repository

https://www.itread01.com/content/1545264914.html


Setting on Eclipse

2021年12月19日 星期日

ANSI console in Eclipse

 ANSI console in Eclipse

看到 standalong 的 springboot 有彩色的console

再看看 eclipse 沒有,覺的難過

Eclipse >> Eclipse Marketplace >>  搜尋安裝 ANSI Escape in Console

Eclipse >> Window >> Preferences >> Ansi Console >>Enable打勾

Eclipse >> Window >> Preferences >> Run/Debug >>Console>>Enable word wrap 取消打勾

Spring boot 專案 >> src\main\resources\application.properties >>

新增

#控制台彩色输出
spring.output.ansi.enabled=ALWAYS

參考

https://www.youtube.com/watch?v=xLrK9PctVAk

https://marketplace.eclipse.org/content/ansi-escape-console?mpc=true&mpc_state=

https://blog.csdn.net/shichen2010/article/details/83031418


2021年11月30日 星期二

invalid element name web.xml eclipse

 

維護古蹟,Eclipse Web.xml 老是報錯
加入下面這兩行
就沒有紅字了

http://www.springmodules.org/schema/cache/springmodules-cache.xsd 

http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd



<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
    http://www.springmodules.org/schema/cache/springmodules-cache.xsd 
    http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

2021年4月23日 星期五

Eclipse 依據副檔名單獨設定檔案編碼

 Eclipse 依據副檔名單獨設定檔案編碼
General
  >> Content Types

Text
  >> Add Child
  >> SQL File


File associations
  >> *.sql


Associated Editor
 >> Text Editor


Default Encoding
  >> MS950

2020年7月22日 星期三

DevStyle for Eclipse

DevStyle for Eclipse
https://www.genuitec.com/products/devstyle/

中二風格

2020年4月3日 星期五

Eclipse i18n properties editor

Eclipse i18n properties editor

參考
https://coffee0127.github.io/blog/2016/08/15/eclipse-poperties/


安裝步驟

  1. Eclipse -> Help -> Install New Software…
  2. 點選 Add…
  3. Name: Properties Editor
    Location: http://propedit.sourceforge.jp/eclipse/updates/
  4. 勾選 PropertiesEditor
    PropertiesEditor_Asian_NLS 是否安裝外掛多國語言 (非必要)
  5. 接著就是 Eclipse 安裝 plugin 時一些同意條款說明
  6. 安裝完成後,在 Eclipse -> Window -> Preferences 即可看見 Properties Editor
  7.  使用外掛提供的 PropertiesEditor 開啟 properties 檔案即可看見中文了
  8. 使用預設的編輯器看,卻仍舊是 Unicode
  9. 若不想將註解也轉為 Unicode,則在 Preferences 裡面勾選 Convert Option 的第二個選項註解不再轉為 Unicode 
  10. 若整份 properties 都不需轉為 unicode 則勾選第一個選項。
    Q:何時會用?
    A:ZK i18n,由於 ZK i18n 讀取的 properties 檔案編碼為 UTF-8,因此不需額外轉為 Unicode

2020年3月30日 星期一

eclipse console size

啟動跑太快
console log 洗光光
調整如下

In Window > Preferences > Run/Debug > Console, there's a checkbox "Limit console output" and a text field for entering the buffer size of the console.

2020年3月24日 星期二

2020年3月13日 星期五

web.xml 不見了

在 Eclipse
  • Dynamic Web Project
  • Right Click
  • Java EE Tools
  • Generate Deployment Descriptor Stub
魔術 神奇的web.xml回來了!!!
感謝 媽祖

2019年8月23日 星期五

Spring Tool Suite 4 初體驗

請先前往下載
https://spring.io/tools









如果你和我一樣有一拖拉庫的JAVA JDK版本

應該會啟動失敗







這時候先別著 砸電腦
先檢查一下 java 環境設定
cmd >> java -version











看到兇手了 jdk 1.6 too old for STS4

此時解決辦法
建立執行檔捷徑 >> 捷徑右鍵內容 >>
加入
-vm C:\Java\java-1.8.0-openjdk-1.8.0.222-2\bin\javaw



















再次執行
神奇的魔術發生了!!!



2019年8月20日 星期二

eclipse The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

eclipse exception show on console
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

1.download from http://tomcat.apache.org/download-native.cgi
2.put tcnative-1.dll into path
3.eclipse tomcat server args past -Djava.library.path="C:\Java\MyLib"

2019年2月11日 星期一

深入淺出SpringBoot Chapter3.1 IoC容器簡介

chapter3 全註解下的 SpringIoC
pom.xml

 4.0.0
 org.springframework.samples
 chapter3
 0.0.1-SNAPSHOT

 

  
  1.6
  UTF-8
  UTF-8

  
  3.2.3.RELEASE

  
  1.0.13
  1.7.5

 

 
  
  
   org.springframework
   spring-context
   ${spring-framework.version}
  
  
   org.springframework
   spring-tx
   ${spring-framework.version}
  

  
  
   org.slf4j
   slf4j-api
   ${slf4j.version}
   compile
  
  
   ch.qos.logback
   logback-classic
   ${logback.version}
   runtime
  
  
   org.projectlombok
   lombok
   1.16.10
   provided
  
  
  
   log4j
   log4j
   1.2.17
  

 



代碼清單3-2 User.java
package com.springboot.chapter3.pojo;
import lombok.Data;
public @Data class User {
 private Long id;
 private String userName;
 private String note;
}


代碼清單3-3 Appconfig.java
package com.springboot.chapter3.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.springboot.chapter3.pojo.User;
@Configuration
public class Appconfig {
 @Bean(name = "user")
 public User initUser() {
  User user = new User();
  user.setId(1L);
  user.setUserName("user_name_1");
  user.setNote("note_1");
  return user;
 }
}



代碼清單3-4 IoCTest.java
package com.springboot.chapter3.config;
import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.springboot.chapter3.pojo.User;
public class IoCTest {
 private static Logger log = Logger.getLogger(IoCTest.class);
 public static void main(String[] args) {
  ApplicationContext ctx =
    new AnnotationConfigApplicationContext(Appconfig.class);
  User user = ctx.getBean(User.class);
  log.info(user);
 }
}


log4j.properties
#定義 Root Logger 的等級為 INFO,且為其指定一個 appender 名為 rootAppender.
log4j.rootLogger=INFO, console

#指定 console 的類型.
log4j.appender.console=org.apache.log4j.ConsoleAppender

#指定 console 的 Layout.
log4j.appender.console.layout=org.apache.log4j.PatternLayout
#log4j.appender.console.Target=System.out
#指定 console Layout 的輸出格式.
log4j.appender.console.layout.ConversionPattern=%5p [%d{yyyy-MM-ddHH:mm:ss}]-[%c{1}:%L][%x] %m%n


Eclipse 看 .properties 亂碼要改




















執行結果