Skip to content

Mac OS X 10.9 Java 1.7 only #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbsqp opened this issue Nov 9, 2013 · 40 comments
Closed

Mac OS X 10.9 Java 1.7 only #1665

dbsqp opened this issue Nov 9, 2013 · 40 comments
Assignees
Labels
Component: IDE The Arduino IDE OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE
Milestone

Comments

@dbsqp
Copy link

dbsqp commented Nov 9, 2013

Current Mac version of the IDE only work with Java 6 runtime from Apple. On a clean install with only Oracle 1.7 SDK installed IDE does not run and prompts to install Java 6 from Apple.

I think the issue does not relate to the core but to the way the application is bundled for Mac OS as Arduino.app. This uses the documented procedure from Apple and is only applicable to their install of Java 1.6.

See here for more info: http://stackoverflow.com/questions/14806709/application-is-using-java-6-from-apple-instead-of-java-7-from-oracle-on-mac-os-x

@dbsqp dbsqp closed this as completed Nov 9, 2013
@dbsqp dbsqp reopened this Nov 9, 2013
@ffissore
Copy link
Contributor

ffissore commented Nov 9, 2013

Are you using version 1.0.x ? If so, can you try latest 1.5.x?

@dbsqp
Copy link
Author

dbsqp commented Nov 9, 2013

Am using 1.0.5 but same issue with 1.5.4. Rebuilding from source didn't help using but is clear from build.xml that this is the older way of making app bundles as compared to what oracle recommend for 1.7 i.e. using appbundler-1.0.jar

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

@ghost ghost assigned ffissore Nov 9, 2013
@okrause
Copy link

okrause commented Dec 16, 2013

Just tested with 1.5.5. Still asks to download Java6. Still no Arduino GUI for me :(

@ericontech
Copy link

I had the same issue on a clean OS X 10.9 machine. Had to pollute it with Java 6 to get the IDE to run.
http://support.apple.com/kb/DL1572

@haavar
Copy link

haavar commented Jan 3, 2014

After working trough some issues, I finally have a build of the IDE that works with java 7. You do not need java 6 installed to run this, but you do need java 7 from oracle. I did not bundle the JRE with the app.

Here is what I did:

  1. Change the build to use appbundler-1.0.jar from oracle to create the app
  2. Invoking Toolkit.getDefaultToolkit() in the Platform constructor because of the issue: http://mail.openjdk.java.net/pipermail/macosx-port-dev/2013-January/005261.html.
  3. Replaced RXTXcomm with nrjavaserial. RXTXcomm did not run in 64 bit mode, and the JRE would not run in 32.

I'm not sure what the process for integrating changes back into this project, but I'd delighted if my changes made it back into the project. Does anyone know how to make that happen?

You can download the binaries that I created here (updated to the 1.5 branch):
[deleted see post below for updated link]

I've tested on OS X 10.9.1, with java 1.7.0_45 and an Arduino Uno.

@dbsqp
Copy link
Author

dbsqp commented Jan 3, 2014

Hi, your binary also works for me on OS X 10.9.1 with an Uno. Great work and thanks for all your help.
Unfortunately I have no idea how to integrate this back into the main project.

@haavar
Copy link

haavar commented Jan 6, 2014

That's great. I did some work with the IDE yesterday, and I noticed that the IDE was taking 300%+ CPU. I've not been diving deep into what's causing that, but I'm guessing it has to do with the serial lib that I used. It would also be more reasonable to include these changes in a 1.5.x release.

I made a new build of the 1.5.x branch. That uses a different serial lib, and initial tests looks good. If anyone wants it, it's here:
https://citrix.sharefile.com/d/sec90014164743969

@choepie
Copy link

choepie commented Mar 6, 2014

Great work ! Thank you very much for this.
Can you tell me what serial lib you used ? I'm trying to get this one up and running for some time now without success : http://www.cheap-thermocam.net/download-section-v1/
I'm afraid the rxtxcomm is a reason.

@haavar
Copy link

haavar commented Mar 6, 2014

Thanks.
I didn't change the serial lib for the 1.5.x branch. All I did was to use the appbundler to create the application instead of the template app. I also added the Toolkit.getDefaultToolkit() hack.

I made some changes to the appbundler project to support file associations. I've published those changes to an appbundler jira taks, but the project seems pretty dead, and I'm not sure if they are gong to pick it up. I didn't want to make a pull request to the arduino project until the changes were in for the appbundler.

I did see that someone branched the appbundler project. That might be something to look at if the main project is dead.

@ffissore
Copy link
Contributor

ffissore commented Mar 7, 2014

@haavar does the bundled Arduino IDE work well even if file associations are not supported? If so, I would love to see a PR from you. Also mind that we don't have particular problems in forking and patching it accordingly or (better) in using a fork of it: for example, take a look at this https://bitbucket.org/infinitekind/appbundler , it looks active

@haavar
Copy link

haavar commented Mar 7, 2014

It works well, but there is some regression in functionality.

Yes, that's the project I was looking at earlier. I think they have all features required. Another option would be to keep the application template technique that's already there, but I thought that was a bit messy.

When I get a chance, I'll make a PR with the alternative appbundler task.

@Knitter
Copy link

Knitter commented Mar 19, 2014

@haavar can you publish the instructions on how to make a build with the appbundler? Or when can we see this change in the nightly builds?

I tried starting Arduino manually using the java command but I may be missing something on either the required libs (and classpath) or the required properties (is javaroot used for anything?) as Arduino's icon shows but the main class just hangs without ever showing any UI, I have to kill the process to stop it.

I'm currently unable to use the Arduino IDE on OSX as I can't get it to start, I suspect this will cause issues to any other user that doesn't want an older JRE on their machine.

@haavar
Copy link

haavar commented Mar 19, 2014

Sorry, I've not been able to put this together in a pull request. I don't see any time in my near future where I'll be able to do this. I'll share my patch, if someone can put together a pull request.

There are 3 parts to my change.

  1. Updating the build.xml file to use appbundler
  2. Adding a call to Toolkit.getDefaultToolkit() because of this issue: http://mail.openjdk.java.net/pipermail/macosx-port-dev/2013-January/005261.html
  3. Making a change to the appbundler to allow file associations and allow versions to be set. The link below contains an appbunlder jar that has those changes. The patch can be found here:
    https://java.net/jira/browse/APPBUNDLER-1. The patch for setting the version is here:
    https://java.net/jira/browse/APPBUNDLER-24

You can download the patched appbunlder and the code changes to the IDE here:
https://citrix.sharefile.com/d/scc82fd895c24ac69

I tried using this project: https://bitbucket.org/infinitekind/appbundler, but I was not able to get the app running.

@Knitter
Copy link

Knitter commented Mar 20, 2014

Thanks for the details.

I've made a first attempt at applying the patch and making my own build and though I can build the project and make an application bundle, the IDE doesn't show any UI, it does seem to start (the process is running and there usual Arduino icon shows) but doesn't show any window. I'll retry again later this week.

@haavar
Copy link

haavar commented Mar 20, 2014

That's what happened to me before I figured out that I had to add the Toolkit.getDefaultToolkit() call. Did you add that? Did you try doing a thread dump? Did you try starting the app by calling java on the command line?

@Knitter
Copy link

Knitter commented Mar 22, 2014

I did add add that line, I applied the path (it lacks the import for the Toolkit class though) and the line is part of the constructor. I did not try to make a thread dump, will try that.

I tried starting in command line, it throws an exception as it doesn't find some packages (probably a classpath issue) but I did not continue to test. If I use either the open command or double click the bundle I can access the settings screen (using the app menu), but no main IDE window shows.

Also, I placed the appbuldler from the link you posted in the expected folder but it complains that it doesn't support the "documentType" element. I had to comment that from the build.xml file to allow it to build.

I'll try to build the IDE again today/tomorrow, thanks for the help.

@haavar
Copy link

haavar commented Mar 24, 2014

That's strange. Maybe there have some more resent changes that broke this.

I might have given you an appbundler jar that does not have my changes. Just comment out the document association element for now.

I've not seen the one where you can see the settings screen. When I tried starting the app without the toolkit hack, nothing would show up.

This is how I ran the app from the command line (current dir is the application bundle):
haavar:Arduino.app haavar$ export CLASSPATH=find . -name *.jar | while read l; do echo -n "$l:"; done;
haavar:Arduino.app haavar$ java -Djavaroot=pwd/Contents/Java processing.app.Base

The output when I ran it like that was usually helpful when I was debugging.

@cmaglie
Copy link
Member

cmaglie commented May 29, 2014

@haavar
I've just made a pull request with all your patches. It seems to work great, may you or anyone else check this out?

#2102

@haavar
Copy link

haavar commented May 30, 2014

Thanks for doing that. The change looks good to me.
There are probably some cleanup that can happen in the template app. The
ant task is doing the creation of the .app structure, and we don't really
need a template any more. However we are probably still using a few files
from the template, and they should be moved elsewhere.

On Thu, May 29, 2014 at 3:37 AM, Cristian Maglie [email protected]
wrote:

@haavar https://github.com/haavar
I've just made a pull request with all your patches. It seems to work
great, may you or anyone else check this out?

#2102 #2102


Reply to this email directly or view it on GitHub
#1665 (comment).

@Lauszus
Copy link
Contributor

Lauszus commented May 30, 2014

I just tried is as well, but looks like all shadows are missing.
Please see the screenshot below:
screenshot

The left is Arduino 1.5.6-r2 while the right is the one build using appbundler.

Am I the only one having this issue?

Also you should properly add "appbundler-1.0-arduino.jar" to .gitignore

@cmaglie
Copy link
Member

cmaglie commented Jun 27, 2014

Added appbundler in .gitignore

I can confirm that the shadows are dimmed, they are still there but they are not so strong.
I've no idea on how to solve this, any suggestion welcome.

Personally I'm fine with this new "style", so I'm going to merge this change upstream anyway (and fix the style later when we figure out how).

@cmaglie cmaglie closed this as completed Jul 2, 2014
@damellis
Copy link
Contributor

damellis commented Jul 2, 2014

Guys, the font / text on this new app bundler / Java 7 IDE look terrible, at least to my eyes (I think I get about the same as the screenshot that Lauszus posted). I think this is bad enough that it's worth switching back to Apple's Java 6 instead (which, anyway, is what you get prompted to install when you try to run a Java application on newer version of Mac OS X).

@Knitter
Copy link

Knitter commented Jul 2, 2014

As one affected by this I prefer the patch, and its associated font issues instead of reverting to Java 6. If I'm faced with choosing between not having the IDE (I don't and won't install Java 6) or having some font issues, I prefer the font issues anytime :)

@dbsqp
Copy link
Author

dbsqp commented Jul 2, 2014

Would just like to say thank you to everyone who worked on this.

@xaljox
Copy link

xaljox commented Jul 3, 2014

With the eclipse arduine plugin which is also java based and now uses Java 7 or above, the small font issue on the mac can be solved by removing the line:
-Dorg.eclipse.swt.internal.carbon.smallFonts
from some sort of ini file on how to run java.
the rest of the file content is:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
-perspective
it.baeyens.arduino.application.perspective
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-Xmx512m
-XstartOnFirstThread

I'm no Java expert, but is seems that the size of the font in Java can be controlled in some manner.

On 03 Jul 2014, at 00:03, David A. Mellis [email protected] wrote:

Guys, the font / text on this new app bundler / Java 7 IDE look terrible, at least to my eyes (I think I get about the same as the screenshot that Lauszus posted). I think this is bad enough that it's worth switching back to Apple's Java 6 instead (which, anyway, is what you get prompted to install when you try to run a Java application on newer version of Mac OS X).


Reply to this email directly or view it on GitHub.

@cmaglie
Copy link
Member

cmaglie commented Jul 3, 2014

It seems that this is a bug in JRE 7:

http://bbs.archbang.org/viewtopic.php?id=2468

@cmaglie
Copy link
Member

cmaglie commented Jul 3, 2014

Err... sorry, posted the wrong link:

https://bugs.openjdk.java.net/browse/JDK-8023794
https://netbeans.org/bugzilla/show_bug.cgi?id=216655

Does anyone knows a workaround for this?

@damellis
Copy link
Contributor

damellis commented Jul 3, 2014

Another consideration is compatibility with older versions of Mac OS X. According to the statistics* I can find, it seems that 20 percent or so of users are on 10.6 or earlier, which won't run Java 7 (I believe).

If there was a compelling need to use Java 7, it might be worth these trade-offs -- but it's not clear to me what that need is, aside from some people not wanting to install Java 6 (for reasons that aren't clear to me). What's the advantage of switching to Java 7?

[*] http://mobilephoneadvise.com/osx-mavericks-already-powering-more-than-50-macs

@dbsqp
Copy link
Author

dbsqp commented Jul 3, 2014

The reasons are clear, Apple will no longer support their build of Java 6.
Also to use your argument 80% of people can use Java 7. This number will only increase with time.

With respect to the build of Arduino, if you look into the code it was quite a hack for the Apple Java 6 bundle. Moving to the standard method provides better standards complaint longer support from this community. There is also nothing stopping you installing Apple's or Oracle's version of Java 6.

There is also nothing stopping my riding my horse to work instead of driving I just haven't found the right place to plug in the iPod :-)

@cmaglie
Copy link
Member

cmaglie commented Jul 4, 2014

Sticking to an old technology has its pro and cons.

Pro:

  • it's tested
  • ensure maximum compatibility with older system

Cons:

  • at some point it becomes unsupported (no bugfix)
  • will start to miss features available on the latest and greatest

Choosing the right time to upgrade is a balance of the above, considering also that delaying a missed update for too long makes the update itself harder and harder (if not impossible). In Arduino we faced similar problems with:

  • AVR-GCC toolchain
  • RXTX vs JSSC
  • Picking the latest upgrades from Processing IDE (right now Arduino diverged too much and this is almost impossible)

For these reasons I want to upgrade to Java 7 ASAP, but @damellis said a right thing here: 20%, even if low, is still a large amount of users (its 1 out of 5) and we can't suddenly drop support for them.

@okrause
Copy link

okrause commented Jul 4, 2014

From my experience all the 10.6 users are non-technical users who use there system for mail and web. Also due to the "upgrade is free" policy of Apple there is no reason not to go with a later release except your hardware is very old. The point I want to make: 20% is already low and I am convinced that the majority of this 20% isn't anyone who will use the Arduino IDE anyway. We talk about a very small number of real users. Please don't push an outdated, not really maintained Java onto the other 80%+ of users. I stopped using the IDE for that reason. I don't want another problem software lurking around, I am already more than busy patching Adobe Flash every week.

@Knitter
Copy link

Knitter commented Jul 4, 2014

To me it is both a matter of not wanting an old and unsupported version of Java in my system and also a requirement to use newer versions for the development I do, but in the end, I would like the ability to run the IDE on Java 7 and 8 and not to be limited to Java 6.

I don't really care if the IDE runs on Java 6 as long as it also runs on Java 7 properly without forcing me to install a lower version with all the issues of having two very different Java JRE/JDK installed. I could live with Java 6 only if it was trivial to have both versions and all my apps using the latest with only the Arduino IDE using the older version, but it is not.

@simonh1000
Copy link

Just downloaded the built code from the link above and it works with Mavericks + Oracle Java 7, so thanks. Would be great if Arduino would just host this directly on their site (marked as an alternative for those that know they are running Java 7)

@Andersos
Copy link

So any updates after @Knitter? Is there an Arduino IDe 1.0.6 version that I can use if I have Java 8?
Do I really have to install Java 6 to run this?

@cmaglie
Copy link
Member

cmaglie commented Nov 17, 2014

There is a Java 7 package for IDE 1.5.8 on the download page of arduino.cc site (I guess it works with java 8 too? a report for that may be useful).

There are no plans to package IDE 1.0.6 for Java 7+.

@ddm
Copy link

ddm commented Dec 31, 2014

The download page version for Java 7 works with Java 8 too (tested with 1.8.0_25 on OS X 10.10.1). Maybe the download link's text could be changed to "Java 7+" to avoid any confusion.

@chenyi1976
Copy link

I am using Yosemite with Java 7 (1.7.0_72), the Arduino IDEs (Java 6 & Java 7) are not working for me.

*If you have Minecraft.app installed like me, just copy contents/MacOS/JavaApplicationStub from Minecraft.app to Arduino.app contents/MacOS/ folder ( overwrite the existing one) *

Cheers

@ffissore
Copy link
Contributor

ffissore commented Mar 4, 2015

Yesterday we pushed a fix for mac. Can you give a spin to the latest
nightly build?
Il giorno 04/mar/2015 07.44, "chenyi1976" [email protected] ha
scritto:

I am using Yosemite with Java 7 (1.7.0_72), the Arduino IDEs (Java 6 &
Java 7) are not working for me.

*If you have Minecraft.app installed like me, just copy
contents/MacOS/JavaApplicationStub from Minecraft.app to Arduino.app
contents/MacOS/ folder ( overwrite the existing one) . *

Cheers


Reply to this email directly or view it on GitHub
#1665 (comment).

@ffissore
Copy link
Contributor

ffissore commented Mar 4, 2015

This is the URL http://arduino.cc/en/Main/Software#nightly

@ffissore
Copy link
Contributor

ffissore commented Mar 4, 2015

@ddm fixed with "7+". sorry for having missed your advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE
Projects
None yet
Development

No branches or pull requests