Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Javaのバージョニング問題の話しよっか
Search
RyotaMurohoshi
January 21, 2016
Technology
0
21
Javaのバージョニング問題の話しよっか
2016/01/21(木)に行われた第1回ゆるゆる高専エンジニアLT大会 at FULLER
の発表資料です。
RyotaMurohoshi
January 21, 2016
Tweet
Share
More Decks by RyotaMurohoshi
See All by RyotaMurohoshi
Unityの合同同人誌や合同商業誌を書いてる僕は感想やレビューや評価が欲しい
ryotamurohoshi
0
420
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
650
Odin Validationはいいぞ!
ryotamurohoshi
2
880
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.3k
Unityでも、新しいC#
ryotamurohoshi
0
1.2k
Riderはいいぞ!
ryotamurohoshi
1
3.3k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.3k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
36k
ImportedLinqのススメ
ryotamurohoshi
0
1.3k
Other Decks in Technology
See All in Technology
AWS re:Invent 2024 ふりかえり勉強会
yhana
0
450
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
3
280
APIとはなにか
mikanichinose
0
110
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.4k
なぜCodeceptJSを選んだか
goataka
0
180
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
120
組み込みアプリパフォーマンス格闘記 検索画面編
wataruhigasi
1
140
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
240
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
830
20241218_今年はSLI/SLOの導入を頑張ってました!
zepprix
0
100
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
How STYLIGHT went responsive
nonsquared
96
5.2k
Thoughts on Productivity
jonyablonski
68
4.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
450
How GitHub (no longer) Works
holman
311
140k
A better future with KSS
kneath
238
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Music & Morning Musume
bryan
46
6.2k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.4k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Transcript
Javaͷόʔδϣχϯά ͷ͠Α͔ͬ ྄ࣨଠ 2016/01/21()(ୈ1ճ(ΏΔΏΔߴઐΤϯδχΞLTେձ(at(FULLER
ಥવͰ͕͢Ͱ͢
͜ͷΫϥεΛؚΉϥΠϒϥϦ͕͋Γ·͢(core_v1.jar) package com.mrstar.versioning_problem.core; public final class Core { private Core()
{} public static String getTitle() { return "΄͛;͕"; } public final static String MESSAGE = "ͽΑͽΑʂ"; }
͖ͬ͞ͷϥΠϒϥϦʹґଘ͢ΔϥΠϒϥϦ͕͋Γ·͢(framework.jar) package com.mrstar.versioning_problem.framework; import com.mrstar.versioning_problem.core.Core; public class Framework { private
Framework(){ } public static void showTitle() { System.out.println(Core.getTitle()); } public static void showMessage() { System.out.println(Core.MESSAGE); } }
None
͜Μͳײ͡Ͱ͍·͢ package com.mrstar; import com.mrstar.versioning_problem.framework.Framework; public class Main { public
static void main(String[] args) { Framework.showTitle(); Framework.showMessage(); } }
࣮ߦ͢Δͱɽɽɽ package com.mrstar; import com.mrstar.versioning_problem.framework.Framework; public class Main { public
static void main(String[] args) { Framework.showTitle(); // ʮ΄͛;͕ʯͬͯදࣔ͞ΕΔ Framework.showMessage(); // ʮͽΑͽΑʂʯͬͯදࣔ͞ΕΔ } }
͔ͬ͜Β͕ϙΠϯτͰ͢ ͏ͪΐͬͱঢ়گઆ໌͕ଓ͖·͢
ԾͷจݴΛຊ൪༻ʹมߋ͠ɺόʔδϣϯΞοϓʢcore_v2.jarʣ package com.mrstar.versioning_problem.core; public final class Core { private Core()
{} public static String getTitle() { return "ϝΠϯϖʔδ"; //ɹ͖ͬ͞·Ͱʮ΄͛;͕ʯ } // ͖ͬ͞·ͰʮͽΑͽΑʂʯ public final static String MESSAGE = "͜Μʹͪʂ"; }
None
core_v2.jarʹஔ͖͑ͯɺframework.jarͦͷ··Ͱ package com.mrstar; import com.mrstar.versioning_problem.framework.Framework; public class Main { public
static void main(String[] args) { Framework.showTitle(); // Q1 ͳΜͯදࣔ͞ΕΔʁ Framework.showMessage(); // Q2 ͳΜͯදࣔ͞ΕΔʁ } }
Q1#ʮFramework.showTitle();ʯ • ʮ΄͛;͕ʯͬͯදࣔ͞ΕΔͱࢥ͏ਓʁ • ʮϝΠϯϖʔδʯͬͯදࣔ͞ΕΔͱࢥ͏ਓʁ
Q2#ʮFramework.showMessage();ʯ • ʮͽΑͽΑʂʯͬͯදࣔ͞ΕΔͱࢥ͏ਓʁ • ʮ͜Μʹͪʂʯͬͯදࣔ͞ΕΔͱࢥ͏ਓʁ
͑߹Θͤʂ
Q1#Framework.showTitle() ʮϝΠϯϖʔδʯͬͯදࣔ͞Ε·͢ ɹ Q2#Framework.showMessage() ʮͽΑͽΑʂʯͬͯදࣔ͞Ε·͢
͋ͬͯͨʁ
ղઆʂ
framework.jarͷFramework.java(࠶ܝ) package com.mrstar.versioning_problem.framework; import com.mrstar.versioning_problem.core.Core; public class Framework { private
Framework(){ } public static void showTitle() { System.out.println(Core.getTitle()); } public static void showMessage() { System.out.println(Core.MESSAGE); } }
͜ΕΛίϯύΠϧͨ݁͠Ռ͕ϙΠϯτʂ framework.jarͷதΛσίϯύΠϧ͢Δͱɽɽɽ
σίϯύΠϧͨ͠Framework.class package com.mrstar.versioning_problem.framework; import com.mrstar.versioning_problem.core.Core; public class Framework { private
Framework() {} public static void showTitle() { System.out.println(Core.getTitle()); } public static void showMessage() { System.out.println("ͽΑͽΑʂ"); } }
ؾ͍ͮͨʁ ͏ҰճΈͯΈ·͠ΐ͏ʂ
Framework.javaͷίʔυ package com.mrstar.versioning_problem.framework; import com.mrstar.versioning_problem.core.Core; public class Framework { private
Framework(){ } public static void showTitle() { System.out.println(Core.getTitle()); } public static void showMessage() { System.out.println(Core.MESSAGE); } }
σίϯύΠϧͨ͠Framework.class package com.mrstar.versioning_problem.framework; import com.mrstar.versioning_problem.core.Core; public class Framework { private
Framework() {} public static void showTitle() { System.out.println(Core.getTitle()); } public static void showMessage() { System.out.println("ͽΑͽΑʂ"); } }
͓Θ͔Γ͍͚ͨͩ·͔ͨ͠ʁ
σίϯύΠϧͨ͠.class Core.MESSAGEͷจࣈྻϦςϥϧͷʮͽΑͽΑʯ ຒΊࠐ·Ε͍ͯ·ͨ͠Ͷʂ
Core.MESSAGEͷจࣈྻϦςϥϧɺ ຒΊࠐ·Ε͍ͯ·ͨ͠Ͷʂ
public'sta+c'final'String'MESSAGE'(ུ) ຒΊࠐ·Ε͍ͯ·ͨ͠Ͷʂ
όʔδϣχϯάʂ ༻ޠࣗମC#ͷͷ
public'sta+c'final'intpublic'sta+c'final'String ΫϥεఆͷՕॴίϯύΠϧ͢Δͱ ɾจࣈྻϦςϥϧʹల։͞Ε·͢ʂ
framework.jar core_v1.jarʹґଘ͠Ϗϧυ͠·ͨ͠ ͦͷޙɺ࠶Ϗϧυ͠·ͤΜͰͨ͠Ͷ
framework.jarΛ࠶Ϗϧυ͢Δ·ͰɺFramewarkΫϥεͷ CoreΫϥεͷఆCore.MESSAGEΛ͍ͬͯΔՕॴ core_v1ͷʮͽΑͽΑʯͷ··Ͱ͢
૾͍ͯͩ͘͠͞ʂ ൛ͷϓϩάϥϜͰςετ༻ͷจݴ͕ग़͖ͯͯ͠·͏ͷΛʂ
((((ʀƅДƅ))))
·͊ͿͬͪΌ͚ ϐϤϐϤ ͱ͔ɺ͔Θ͍͍ΜͩΑͶ()
ʮ͜͜ʹࣹ৺ΛδϟϒδϟϒἤΔจݴʯ স͑ͳ͍Ͷ
ϙΠϯτ͓͞Β͍ public'sta+c'final'intΈ͍ͨͳఆ ίϯύΠϧ͢ΔͱϦςϥϧͱͯ͠ల։͞ΕΔ ※ϓϦϛςΟϒܕͱStringܕ
ʮframework.jar࠶Ϗϧυ͢ΓΌΑ͘Ͷʁʯ ·͊ͦ͏ͳΜ͚ͩͲɺJavaॻ͘ͳΒ͜Εͬͱ͍ͯ΄͍͠ ఆ͕ຒΊࠐ·ΕͯࢥΘ͵όάͷݪҼʹͳΔ͔Βʂ
͘ͳΓ·͕ͨࣗ͠ݾհ • ྄ࣨଠ • ࠷ॳJavaͰAndroid+(2016ͰJava6+orz) • ࠷ۙ·ͰC#ͰUnity+(2016ͰC#3.0(Ұ෦4.0)+orz) • ࠓTypeScriptͰNode.js+(JavaScriptΉ͍ͣͶ)
ʮόʔδϣχϯάɺكͳέʔεͳΜͰ͠ΐʁʯ
Θͨͦ͠͏ࢥ͍ͬͯͨ࣌ظ͕͋Γ·ͨ͠ɻ
ڈૺ۰͠·ͨ͠ Unity&+&Android&+&͋ΔࠂSDKͰ
·ͨ·ͨͰ͢ʂ ࠓAndroidܦݧऀ͕ର
AndroidͰpublic,sta0c,final,int ͳΑ͘͏ͭͬͯͳʙΜͩʂʁ
RΫϥε
R.layout.activity_mainͷΑ͏ͳϦιʔεID ϨΠΞτը૾ʹৼΒΕΔϦιʔεID(intͳఆ) RΫϥεͷύοέʔδ໊ΞϓϦͷύοέʔδ໊ʹ
RΫϥεͷϦιʔεIDར༻ྫ public class MainActivity extends Activity { @Override protected void
onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // ͜ΕʂʂʂϏϧυ͢ΔͱϦςϥϧʹ setContentView(R.layout.activity_main); } }
Unity&+&Android&+&͋ΔࠂSDKͰ όʔδϣχϯά͕ݪҼͷෆ۩߹ʹૺ۰ʂ
Unity+Android+͋ΔࠂSDKͷߏྫ ͜ΕUnity4·ͰͷΓํͰݱࡏඇਪ
None
ϨΠΞτͷXMLը૾ͳͲͷϦιʔε ্هϦιʔεΛ͏ࠂදࣔػೳͷjar (AndroidManifest.xml)
jarͷதͷΫϥεͰɺR.layout.activity_main Έ͍ͨͳϦιʔεIDͷఆɺϦςϥϧͱͯ͠ల։͞ΕͯΔΑͶʂ
UnityϏϧυ࣌ɺAndroidͷΞϓϦΛ࡞ΔͨΊ ৽ͨʹAndroidϓϩδΣΫτΛ࡞ͬͯ ͜ͷλΠϛϯάͰϦιʔεʹ࠶ϦιʔεID͕ৼΒΕ·͢
None
jarͷதͷΫϥεͰɺR.layout.activity_main Έ͍ͨͳϦιʔεIDͷఆɺϦςϥϧͱͯ͠ల։͞ΕͯΔΑͶʂ
͠
ϓϥάΠϯ͕ೋͭʹͳͬͨΒ
None
ϓϥάΠϯ͕ೋͭʹͳͬͨΒ
͜ͷঢ়ଶͰAndroidϓϩδΣΫτΛ࡞Γ ϦιʔεIDΛৼΓͨ͠Β
ϓϥάΠϯͷJarͷதͷϦςϥϧͱ Unity͕৽ͨʹ࡞ΔϦιʔεIDͷ͕ ͣΕΔʂ
࣮ߦ࣌Τϥʔʂ
λν͕ѱ͍
public'sta+c'final'int͕ϕλॻ͖͞Εͨ jarΛ࡞ͬͨSDK։ൃऀ͕ѱ͍ʂ jarͷதͷϦιʔεIDͱUnity͕࡞ΔAndroidϓϩδΣΫτͷϦιʔεIDͱ͕Ұக͠ͳ͍ʂ
࠷ѱɺඇৗʹΪϧςΟ
ͯͯ͞͞ɺ όʔδϣχϯά ཧղͯ͠Β͑·͔ͨ͠ʁ
ΈΜͳόʔδϣχϯάΛ Ҿ͖ىͦ͜͠͏ͳϥΠϒϥϦ ࡞ͬͪΌ͍͚·ͤΜΑʂ
ଋͳʂ
Javaͷόʔδϣχϯάͷ͠Α͔ͬ ɹ ྄ࣨଠ 2016/01/21()(ୈ1ճ(ΏΔΏΔߴઐΤϯδχΞLTେձ(at(FULLER