arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.14k stars 7k forks source link

Command line options not working at all [OS X - Java 7 Bundle] #2342

Closed aknoerig closed 9 years ago

aknoerig commented 10 years ago

I'm trying to get the CLI to work as described here: https://github.com/arduino/Arduino/blob/ide-1.5.x/build/shared/manpage.adoc

I'm using 1.5.8 with Java 7 on OS X, and am aware that I have to use the full path to Arduino.app/Contents/MacOS/JavaAppLauncher (which btw needs to be updated in the manpage). However, any command line arguments are always ignored, and Arduino is always launching with the GUI and an empty sketch.

Thanks for any pointers.

matthijskooijman commented 10 years ago

Hmm, if that path changed, I suspect that the method of launching the application has changed and the new method doesn't pass on commandline arguments or something like that. @cmaglie, do you remember any changes in this regard?

aknoerig commented 10 years ago

Thanks, that's indeed where the problem is. I just cloned the current master and built it, and there everything is correct. So it seems that it is "just" the binary download of the Java 7 version that has this issue. For some reason the Launcher got renamed in there.

Can we expect a fix for this sometime soon? We would like to incorporate the command line functionality into Fritzing and this would save a lot of confusion. :)

matthijskooijman commented 10 years ago

If you tried master, that's the 1.0.x release series. The 1.5.x releases come from the ide-1.5.x branch, so that might explain the difference. Could you try with ide-1.5.x as well?

aknoerig commented 10 years ago

Sorry, I actually did try the ide-1.5.x branch. As I said, that branch is fine, but it seems that the Java7 build is done from another branch? I just notice there is also an ide-1.5.x-java7 branch, but that seems to be outdated and fails to build for me. Do you know how the java7 version has been built?

cmaglie commented 10 years ago

@aknoerig I've just pushed an update to the ide-1.5.x-java7 branch. I've used it locally during the release, but forgot to push, sorry...

matthijskooijman commented 10 years ago

@cmaglie, hmm any reason not to merge that branch into ide-1.5.x? It has (apparently) been used to release 1.5.8, so it shouldn't be hidden in a separate branch? Also, shouldn't the 1.5.8 tag be updated to point to this commit? It now doesn't point to the actual code used for the release (at least not for OSX)...

cmaglie commented 10 years ago

If we merge the ide-1.5.x-java7 branch into ide-1.5.x we will not be able to build for Java 6 any more and Java 7 has still some unresolved problems on OSX (font rendering first, but I see some discussions where users are unable to run the IDE and the reason is still unknown).

The best solution would be to make the java7 build parametric, so we can build for java6 and 7 with a single build.xml, but this is not a priority right now (BTW I'll be happy to review/merge a pull request if someone cares to do).

matthijskooijman commented 10 years ago

Ah, I seen now that there are two different versions of the 1.5.8 release for OSX, didn't realize that. In that case, merging doesn't make sense indeed, but I think a 1.5.8-osx-java7 tag might be good?

cmaglie commented 10 years ago

Yeah, I'm doing so. I'd want also to edit on the download page to make it clearer that the Java 7 version is still experimental.

aknoerig commented 10 years ago

Thanks for the push, I just built it and indeed the problem concerning the command line is in there. But I'm not sure how it comes about. This is what I could find:

.

~/Documents/Arduino/build/macosx/appbundler-1.0-arduino.jar:
<binary>

~/Documents/Arduino/build/macosx/work/Arduino.app/Contents/Info.plist:
6  <string>English</string>
7  <key>CFBundleExecutable</key>
8: <string>JavaAppLauncher</string>
9  <key>CFBundleIconFile</key>
10  <string>processing.icns</string>

So it looks like this is introduced during the build process.

aknoerig commented 10 years ago

I suspect the issue is with appbundler-1.0-arduino.jar. It is downloaded during the build process and apparently taken as the app template, instead of the the template.app directory. In ide-1.5.x branch, there is no reference to this appbundler in the build.xml.

cmaglie commented 10 years ago

@aknoerig Take a look also here https://github.com/arduino/Arduino/pull/2102 for some more details. We used (a patched version of...) appbundler to create the template for java 7 on mac ad suggested from a patch originally sent by @haavar

aknoerig commented 10 years ago

Thanks, but that's getting too involved for me, sorry! I have no clue about the differences between how Java 6 and 7 handle this. But I assume the simple fix would be to change the arduino-customised applauncher to use JavaApplicationStub instead of JavaAppLauncher, or vice versa.

ffissore commented 9 years ago

Fixed since 1.6.2

ajfisher commented 9 years ago

I don't believe this is fixed. I'm trying to run from command line using 1.6.4 at the moment and any instruction passed to /Applications/Arduino.app/Contents/MacOS/Arduino are simply ignored and the IDE starts with a blank new sketch - usually with the error of "can't open sketch ..."

Could this be a regression?

facchinm commented 9 years ago

Hi @ajfisher , could you test with the latest nightly? Every problem with CLI on Mac should have been solved with #1493

ajfisher commented 9 years ago

Confirmed it's working in nightly. How long until this hits release? I'm worried about NodeBots day coming up next weekend and us not having a reliable CLI tool for OSX for that.