[精讚] [會員登入]
551

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

你可能感興趣的文章

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

回應 修正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

更新程式取消google recaptcha改用輸入驗證碼 update cnclibs to 0.0.8.6

縣市端新增師生關係API程式 在縣市端建立可由教育部主機撈取縣市資料庫師生關係的API 程式

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[java]縣市IDP建置 使用NetBeans建置IDP程式

centos7 apache ssl.conf設定狀況 在apache更新或重啟後可能遇到ssl.conf衝突問題

setup jira using ssl on apache reverse proxy 設定jira使用https連線

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

在windows server建立radius服務使用active directory帳號驗證 setup windows server to add radius service using active directory accounts for authentication