åè
- Mac OSXにOpenJDKをインストール #openjdk #java7 - #侍ズム
- openjdk-osx-build - OpenJDK 7 and 8 Community packages for OS/X Snow, Lion and Mountain Lion - Google Project Hosting
ãããããããMacBookAirè²·ã£ããã§ãããTwitterã§ã¯è¨ã£ã¦ã¾ãããã©ãæ¸ãã¦ãªãã£ãæ°ããã¾ãã11ã¤ã³ãã®æå°æ§æãä¸çªå®ãã®ã§ããSSDã ãã¡ã¢ãªãããªè¦ããªãããªã¼ã¨ãæã£ã¦ããã¨åMacãªã®ã§ææªå¤±æãã¦ãè¯ãããã«ã¨ãææã§ãããã©ããã¨ã¤ãã§ã«USé
åãã¼ãã¼ãã§ãããã£ãããããããã¼ãããã®ã²ãããªã¨ãã ãããããªãã§ããããããªçç±ããã®MBAã¯ç§ã®ãªã®ã§ããã¾ããã
ãããªããã§æ°ããã³ã³ãã¥ã¼ã¿ãè²·ã£ããããã¡ããJavaã¨Groovyãå
¥ããªãã¨ãããªãã§ãã
Groovy㯠Homebrew ã§è¯ãã£ã½ããã§ããã©ãJavaã¯ããããããªãããªã®ã§ãå
é ã«ãããここãããã¦ã³ãã¼ããã¦ã¤ã³ã¹ãã¼ã«ãã¾ãããªã«ã¶ãåMacãªãã§ãdmgã£ã¦ãªããããï¼ãã¨ãããã§ããã©ãä½ã¨ããªãã¾ããããã£ã¹ã¯ã¤ã¡ã¼ã¸ãããã§ãããããããããªããã©zipã¿ãããªããããªã¨æã£ã¦ã¾ããéãããä¸ã«ã¤ã³ã¹ãã¼ã©ã¼ãããã®ã§å®è¡ããã®ã¾ã¾ã¤ã³ã¹ãã¼ã«ãããããããªããã£ã¬ã¯ããªã«ã¤ã³ã¹ãã¼ã«ããã¾ããã©ãã¨ããããããã§åãã¦ããããããã
GroovyConsoleãåããªã
Macã ã¨GroovyConsoleãåããªãã£ã¦ã®ã¯åããè¨ããã¦ã話ããã©ä»æ¥ kwkmsj ããã®ãã¤ã¼ããè¦ãã¾ãã¦ã
Airof:~ irof$ groovyconsole Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130) Caused by: java.lang.NoClassDefFoundError: com/apple/eawt/ApplicationListener at com.apple.mrj.MRJApplicationUtils.registerAboutHandler(MRJApplicationUtils.java:64) at com.apple.mrj.MRJApplicationUtils$registerAboutHandler.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at groovy.ui.script13154933244431558877614.run(script13154933244431558877614.groovy:22) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1117) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1103) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1053) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:793) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:776) at groovy.util.FactoryInterceptorMetaClass.invokeMethod(FactoryBuilderSupport.java:1274) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) at groovy.ui.view.MacOSXMenuBar.run(MacOSXMenuBar.groovy:46) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1117) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at groovy.ui.Console$__clinit__closure23.doCall(Console.groovy:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at groovy.ui.ConsoleView$_run_closure1.doCall(ConsoleView.groovy:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at groovy.ui.ConsoleView$_run_closure1.doCall(ConsoleView.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883) at groovy.lang.Closure.call(Closure.java:410) at groovy.lang.Closure.call(Closure.java:404) at groovy.util.FactoryBuilderSupport.dispathNodeCall(FactoryBuilderSupport.java:838) at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:744) at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:464) at groovy.util.FactoryInterceptorMetaClass.invokeMethod(FactoryBuilderSupport.java:1272) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) at groovy.ui.ConsoleView.run(ConsoleView.groovy:51) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1117) at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1103) at groovy.util.FactoryBuilderSupport$build.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at groovy.ui.Console.run(Console.groovy:301) at groovy.ui.Console$run$0.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at groovy.ui.Console.run(Console.groovy:264) at groovy.ui.Console$run.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at groovy.ui.Console.main(Console.groovy:199) ... 6 more Caused by: java.lang.ClassNotFoundException: com.apple.eawt.ApplicationListener at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 108 more
ã ãããããã¾ãããã¯ããã£ã¦ã¾ãã
ãã®æç¹ã§å
¥ã£ã¦ããã®ã¯Groovy1.8.1ã§ãããGroovy1.8.2ãåºã¦ã¾ããbrew upgrade ãå©ãã¦Groovyãæ´æ°ãã¤ãã§ã«Jenkinsãæ´æ°ãJenkinsã¯é¢ä¿ãªãã§ããã©ãæ´æ°ãçµãã£ããGroovyConsoleãå度å®è¡ã
Airof:~ irof$ groovy -version Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 Groovy Version: 1.8.2 JVM: 1.7.0-internal Airof:~ irof$ groovyconsole Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130) Caused by: java.lang.NoClassDefFoundError: com/apple/eawt/ApplicationListener ï¼ç¥ï¼
ããããã
openjdk-osx-buildãè¦ã«è¡ã£ãã OpenJDK-OSX-1.7-universal-20110908.dmg ãããã¾ãããç§ãåã«ã¤ã³ã¹ãã¼ã«ããã®ã¯ 20110810 ã«ãªã£ã¦ã¾ãããããä¸ã¶æãçµã¤ãã ãªã¼ã¨ãæããªããæ´æ°ã
Airof:~ irof$ java -version Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 registered thread 0x10100b800 registered thread 0x102801000 registered thread 0x100836000 registered thread 0x100836800 registered thread 0x101022800 registered thread 0x101025800 registered thread 0x101026000 registered thread 0x100840000 registered thread 0x101032000 registered thread 0x102855000 registered thread 0x102856000 registered thread 0x101029000 openjdk version "1.7.0-internal" OpenJDK Runtime Environment (build 1.7.0-internal-b00) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
ãªããã¹ã¬ããã®ãã°ã§ãããããåºãããã«ãªãã¾ãããã¤ã³ã¹ãã¼ã«å¤±æããã®ãã¨ãã®ãã«ããã£ã¦ã¿ã¾ãããã©ç¹ã«å¤ããããæ°ã«ããªãäºã«ãã¾ãã
ã¨ãããã GroovyConsole ã¯åãããã«ãªãã¾ããã
ghello ã ã£ã¦æ¸ãã¡ããã¾ããå®è¡ãããã³ã« registerd thread ãã³ã³ã½ã¼ã«ã«ã´ããã´ããåºã¾ããã©ããããæ°ã«ãã¾ãããJDKæ´æ°ããããã®ãã¡åºãªããªãããããªãã§ãããããã
GroovyConsoleãçµäºããªã
ãã¨ãã¿ã¼ããã«ã§Ctrl+Cããªãã¨çµãããªã
Control+C ããã°çµäºã¯ãããã ãã©ããªããæ°æã¡æªããã¨ããã Control ãã¼æ¼ãè¾ãã
ã¨ãããã System.exit 0 ã GroovyConsole ã§å©ãã¦ã¿ããããããªãçµäºãã¦ããããGroocyConsole ã®ä¸èº«ããã£ããæ®éã«çµäºãã¦ãããæ§ã«ãªãã ãããã