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
20
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
370
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
630
Odin Validationはいいぞ!
ryotamurohoshi
2
860
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.3k
Unityでも、新しいC#
ryotamurohoshi
0
1.2k
Riderはいいぞ!
ryotamurohoshi
1
3.2k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.2k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
36k
ImportedLinqのススメ
ryotamurohoshi
0
1.3k
Other Decks in Technology
See All in Technology
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
110
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
AIチャットボット開発への生成AI活用
ryomrt
0
170
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
260
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
210
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Statistics for Hackers
jakevdp
796
220k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Fireside Chat
paigeccino
34
3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Teambox: Starting and Learning
jrom
133
8.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Gamification - CAS2011
davidbonilla
80
5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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