Skip to content

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

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
aknoerig opened this issue Oct 2, 2014 · 17 comments
Closed

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

aknoerig opened this issue Oct 2, 2014 · 17 comments
Assignees
Labels
Component: IDE user interface The Arduino IDE's user interface OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE Type: Bug
Milestone

Comments

@aknoerig
Copy link

aknoerig commented Oct 2, 2014

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
Copy link
Collaborator

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
Copy link
Author

aknoerig commented Oct 3, 2014

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
Copy link
Collaborator

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
Copy link
Author

aknoerig commented Oct 5, 2014

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
Copy link
Member

cmaglie commented Oct 7, 2014

@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
Copy link
Collaborator

@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
Copy link
Member

cmaglie commented Oct 7, 2014

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
Copy link
Collaborator

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
Copy link
Member

cmaglie commented Oct 7, 2014

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
Copy link
Author

aknoerig commented Oct 7, 2014

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:

  • build/macosx/template.app has JavaApplicationStub as the launcher, just as the Java6-based branch
  • when I search the source, there is no mention of JavaAppLauncher
  • after the build, all of a sudden the launcher in work/Arduino.app is called JavaAppLauncher, and any arguments are ignored, as described in the original post
  • when I search again, there are now two occurences of JavaAppLauncher:

.

~/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
Copy link
Author

aknoerig commented Oct 7, 2014

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
Copy link
Member

cmaglie commented Oct 7, 2014

@aknoerig
Take a look also here #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
Copy link
Author

aknoerig commented Oct 7, 2014

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.

@cmaglie cmaglie changed the title Command line options not working at all (OS X) Command line options not working at all [OS X - Java 7 Bundle] Oct 8, 2014
@ffissore
Copy link
Contributor

Fixed since 1.6.2

@ffissore ffissore added the OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE label May 28, 2015
@ffissore ffissore added this to the Release 1.6.5 milestone May 28, 2015
@ffissore ffissore self-assigned this May 28, 2015
@ajfisher
Copy link

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
Copy link
Member

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

@ajfisher
Copy link

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.

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

No branches or pull requests

6 participants