{"id":1190,"date":"2022-08-23T15:21:43","date_gmt":"2023-09-22T22:31:49","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/uncategorized\/revised-the-executable-has-encountered-an-error-due-to-an-incompatible-cpu-type-attempting-to-install-java-on-a-macbook\/"},"modified":"2024-03-12T15:18:52","modified_gmt":"2024-03-12T15:18:52","slug":"error-attempting-to-install-java-on-a-macbook","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/","title":{"rendered":"error Attempting to install Java on a MacBook."},"content":{"rendered":"<p>After recently purchasing a new MacBook Air M1, the first thing I aimed to do was install Java. Consequently, I downloaded the OpenJDK tar file, extracted it, and attempted to execute the command &#8220;java -version,&#8221; only to encounter an error.<\/p>\n<p>The executable file &#8220;.\/java&#8221; is encountering an error due to an incompatible CPU type.<\/p>\n<p>I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting online searches and debugging, I discovered that the issue arises due to the new MacBook M1 chip&#8217;s utilization of the ARM64 architecture, while the downloaded OpenJDK binaries from the JDK site are designed for x64 architecture typically used by Intel processors.<\/p>\n<h2>The solution to the error message &#8220;-bash: .\/java: Bad <a href=\"https:\/\/en.wikipedia.org\/wiki\/Central_processing_unit#:~:text=A%20central%20processing%20unit%20(CPU,(I%2FO)%20operations%2e\">CPU<\/a> type in executable&#8221; needs to be applied.<\/h2>\n<p>Once the problem was recognized, solving it became effortless. All I had to do was locate an OpenJDK version compatible with ARM64 architecture. After conducting a few searches, I stumbled upon the Azul Zulu OpenJDK builds page, which provided the ARM 64-bit architecture build I needed.<\/p>\n<p>I successfully downloaded the tar file, extracted it, ran the java command, and had no issues.<\/p>\n<pre class=\"post-pre\"><code>$ <span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-O<\/span> https:\/\/cdn.azul.com\/zulu\/bin\/zulu16.30.19-ca-jdk16.0.1-macosx_aarch64.tar.gz\r\n$ <span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-xvf<\/span> zulu16.30.19-ca-jdk16.0.1-macosx_aarch64.tar.gz \r\n$ <span class=\"token builtin class-name\">cd<\/span> zulu16.30.19-ca-jdk16.0.1-macosx_aarch64\/bin\r\n$ .\/java <span class=\"token parameter variable\">-version<\/span>\r\nopenjdk version <span class=\"token string\">\"16.0.1\"<\/span> <span class=\"token number\">2021<\/span>-04-20\r\nOpenJDK Runtime Environment Zulu16.30+19-CA <span class=\"token punctuation\">(<\/span>build <span class=\"token number\">16.0<\/span>.1+9<span class=\"token punctuation\">)<\/span>\r\nOpenJDK <span class=\"token number\">64<\/span>-Bit Server VM Zulu16.30+19-CA <span class=\"token punctuation\">(<\/span>build <span class=\"token number\">16.0<\/span>.1+9, mixed mode<span class=\"token punctuation\">)<\/span>\r\n$\r\n<\/code><\/pre>\n<h2>In summary<\/h2>\n<p>I had never encountered the &#8220;Bad CPU type in executable&#8221; issue before, but if you&#8217;re here, it probably means you&#8217;re dealing with it too. Whether it&#8217;s Java or any other program, all you need to do is locate the appropriate ARM 64-bit architecture version of the software, and everything should work smoothly.<\/p>\n<h2>One possible paraphrase of &#8220;Rosetta 2&#8221; is &#8220;Rosetta Two.&#8221;<\/h2>\n<p>Once my Java setup was complete, I discovered the possibility of installing &#8220;Rosetta 2&#8221; as well. This small tool operates silently and enables the execution of software designed for Intel x64 architecture on Macs powered by Apple chips. For further information, refer to this Apple Support discussion.<\/p>\n<p>&nbsp;<\/p>\n<p>More tutorials<\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/python-compiler-error-during-package-installation\/\" target=\"_blank\" rel=\"noopener\">Python Compiler Error during package installation?<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/common-errors-that-occur-when-using-nginx-for-connections\/\" target=\"_blank\" rel=\"noopener\">Common errors that occur when using Nginx for connections.<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/a-native-guide-to-the-atop-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">A native guide to the atop command in Linux<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\" target=\"_blank\" rel=\"noopener\">automatic scaling of Kubernetes pods using Metrics Server?<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/addition-assignment-operator-in-java\/\" target=\"_blank\" rel=\"noopener\">Addition Assignment Operator mean in Java<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After recently purchasing a new MacBook Air M1, the first thing I aimed to do was install Java. Consequently, I downloaded the OpenJDK tar file, extracted it, and attempted to execute the command &#8220;java -version,&#8221; only to encounter an error. The executable file &#8220;.\/java&#8221; is encountering an error due to an incompatible CPU type. I [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1190","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>error Attempting to install Java on a MacBook. - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"error Attempting to install Java on a MacBook.\" \/>\n<meta property=\"og:description\" content=\"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-22T22:31:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-12T15:18:52+00:00\" \/>\n<meta name=\"author\" content=\"Noah Thompson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Noah Thompson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\"},\"author\":{\"name\":\"Noah Thompson\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\"},\"headline\":\"error Attempting to install Java on a MacBook.\",\"datePublished\":\"2023-09-22T22:31:49+00:00\",\"dateModified\":\"2024-03-12T15:18:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\"},\"wordCount\":392,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\",\"name\":\"error Attempting to install Java on a MacBook. - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2023-09-22T22:31:49+00:00\",\"dateModified\":\"2024-03-12T15:18:52+00:00\",\"description\":\"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"error Attempting to install Java on a MacBook.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\",\"name\":\"Noah Thompson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"caption\":\"Noah Thompson\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"error Attempting to install Java on a MacBook. - Blog - Silicon Cloud","description":"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/","og_locale":"en_US","og_type":"article","og_title":"error Attempting to install Java on a MacBook.","og_description":"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting","og_url":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2023-09-22T22:31:49+00:00","article_modified_time":"2024-03-12T15:18:52+00:00","author":"Noah Thompson","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Noah Thompson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/"},"author":{"name":"Noah Thompson","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a"},"headline":"error Attempting to install Java on a MacBook.","datePublished":"2023-09-22T22:31:49+00:00","dateModified":"2024-03-12T15:18:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/"},"wordCount":392,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/","url":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/","name":"error Attempting to install Java on a MacBook. - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2023-09-22T22:31:49+00:00","dateModified":"2024-03-12T15:18:52+00:00","description":"I had never encountered this type of error before, as I have been working with Java and Mac OS for a long time. However, after conducting","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/error-attempting-to-install-java-on-a-macbook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"error Attempting to install Java on a MacBook."}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a","name":"Noah Thompson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","caption":"Noah Thompson"},"url":"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/1190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=1190"}],"version-history":[{"count":0,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/1190\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=1190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=1190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=1190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}