[精讚] [會員登入]
1316

更新程式環境到wildfly18+openjdk11-phase2: update IDEA to jdk11

更新IDEA 編譯環境

分享此文連結 //n.sfs.tw/14516

分享連結 更新程式環境到wildfly18+openjdk11-phase2: update IDEA to jdk11@外行中的外行
(文章歡迎轉載,務必尊重版權註明連結來源)
2020-04-11 22:25:08 最後編修
2020-02-06 23:42:30 By jung
 

除了系統更新,要先確認IDEA環境更新為openjdk11,才能使用jdk11 的函式庫

1.先到 https://adoptopenjdk.net 下載最新版的openjdk11openJ9

tar解壓縮後,進到IDEA就可以指定要使用的版本,跟本機的JAVA版本可以不同

如果是MAC OS還要到系統設定System Preference開啟允許adoptopenjdk

在Project Structure->SDKs可用+指定jdk目錄位置

 2. 在IDEA指定Project SDK = openjdk11, Project Language Level = 8-Lambdas

因為程式寫法尚未全部更換為java 11

然後每個Modules的 Language Level也維持8-Lambdas

3.重新匯入gitlab主機的憑證給IDEA認證

3-1:

keytool -importcert -storepass changeit -trustcacerts -alias TWCAROOT -file root.cer -noprompt

3-2:

keytool -importcert -storepass changeit -trustcacerts -alias TWCAUCA -file uca.cer -noprompt

為了可以自動更新 repositories,一定要做這件事,否則POM會有錯誤

在idea的Preferences->Build,Execution,Deployment->選擇Repositories,點選URL就可以手動再Update

 

4. Merge tc-idp-wicket8分支:這邊基本上會正常完成,主要是POM dependencies 相依函示庫的更新

合併完成後,須將這個相依先註解,否則編譯時會找不到這個函式庫

<!-- Test for accountdatasource
<dependency>
    <groupId>info.sls</groupId>
    <artifactId>tcaccountdatasource</artifactId>
    <version>0.0.3</version>
</dependency>
-->

5. 本地xxauth更新:這裡會遇到org.apache.commons.configuration這個套件已經不支援jdk11

5-1:引入org.apache.commons.configuration2

5-2:在xxscopes.java這支程式需要修改

try {
            File propertiesFile = new File(EduTool.BASE_PROP_DIR.concat("xxscopes.properties"));
//要將xxscopes.properties檔案放到idp host /opt/settings目錄下

            logger.info("MongoDB sysconfig.properties : {}", propertiesFile.exists());
            Parameters parameters = new Parameters();
            ReloadingFileBasedConfigurationBuilder<FileBasedConfiguration> builder =
                    new ReloadingFileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
                            .configure(parameters.fileBased()
                                    .setListDelimiterHandler(new DefaultListDelimiterHandler(','))
                                    .setFile(propertiesFile)
                            );
            PeriodicReloadingTrigger trigger = new PeriodicReloadingTrigger(builder.getReloadingController(),
                    null, 1, TimeUnit.MINUTES);
            trigger.start();
            Configuration properties = builder.getConfiguration();
            Iterator<String> it = properties.getKeys();
            while (it.hasNext()) {
                String key = it.next();
                ASMapping.put(key, properties.getString(key, ""));
            }
        } catch (ConfigurationException ex) {
            logger.error(ex.getLocalizedMessage());
        }

---未完待續

 

END

你可能感興趣的文章

回應 修正pom.xml,

在apache http server停用TLS 1.0/1.1 and SSL 2.0/3.0 How to disable outdated versions of SSL/TLS on Apache

新增縣市端回傳使用者資料功能 新增縣市端回傳使用者資料功能

縣市端IdP新增自訂首頁內容功能 合併本部主程式,手動於mongo內新增管理使用者資料

更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server 更新程式環境到wildfly18+openjdk11-phase1: upgrade mongodb server to version 3.6

縣市端新增syncdata spi功能 為了讓部裡主機可以透過OAUTH2流程,呼叫縣市同步SYNCDATA 的API

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

使用virtualbox每次都忘記的事情 share folder from win host to linux guest vm

ubuntu18.04網路設定無法啟動問題 network connection failed due to networkmanager settings

zfs on ubuntu 20.04 how to destroy zfs pool while error message said pool is busy

how to add physical disks into HP smart array through esxi interface 如何在磁碟陣列卡上加入新的硬碟-未完待續

openssl package update issue caused by cve-2022-2068 centos7 is at maintenance support phase2, only critical impact security issues will be patched