[精讚] [會員登入]
1278

更新程式環境到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

你可能感興趣的文章

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

縣市IDP新增API功能 修改IDP程式增加API介面

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

系統不正常關機導致mongodb啟動失敗 重新安裝mongodb使用mongorestore

solution for selinux issue while installing zabbix agent on centos7 install zabbix agent as service will raise selinux issue on some centos 7.3.1611

回應 修正pom.xml,

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[NetBeans]如何從git下載專案改建為自己的專案 修改git專案

bitbucket repository control application setup 安裝完bitbucket服務後,須設定bitbucket.properties

JIRA using gmail as smtp outgoing mail sender 如何設定jira使用gmail信箱送信

how to resolve memory allocation issue on proxmox when creating vm, sometimes the log shows fail message of Cannot_allocate_memory

在IDEA從JDK8升級到JDK11遇到的奇怪問題 在IDEA遇到的JAVA11函式庫引入問題