Skip to content
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

jre_emul_dist Error 2: #915

Closed
NikolBoh opened this issue Nov 29, 2017 · 15 comments
Closed

jre_emul_dist Error 2: #915

NikolBoh opened this issue Nov 29, 2017 · 15 comments
Labels

Comments

@NikolBoh
Copy link

Hi!
I first started using j2objc (2.0.5),
After running make dist in the directory /j2objc/ gives an error:
"
Building j2objc annotations
mvn -q generate-resources dependency: sources
building j2objc jar
building jre_emul.jar
building jre_emul-src.jar
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: line 0: [: / Users / XXXX / Documents / ?: binary operator expected
/ bin / sh: ... / jre_emul / build_result / Classes / .translate_mark_jre_emul: No such file or directory
....
"
And there are about 30 such lines.
How to fix? What is the reason?

@tomball
Copy link
Collaborator

tomball commented Nov 29, 2017

There's something unusual in your Mac's build environment (if you aren't building on a Mac, then close this bug since a Mac is required to build with any iOS or macOS SDK).

First, run ps to make sure you are using the bash shell. While other shells probably work, that's the default Mac shell and what the j2objc team uses.

Next, run clang --version to see if it's at least version 8 (current version is 9.0.0), and xcrun --show-sdk-version to check for an iOS SDK of 9 or higher.

If those are okay, run which make to ensure you're running /usr/bin/make, and make -v to make sure you're running GNU Make 3.8 or later. That's important because some of j2objc's build macros use the $? operator.

@NikolBoh
Copy link
Author

NikolBoh commented Dec 1, 2017 via email

@tomball tomball added invalid and removed question labels Dec 1, 2017
@tomball
Copy link
Collaborator

tomball commented Dec 1, 2017

There's no magic here: J2OBJC_HOME is just an environment variable. Try testing it on the command line, outside of Xcode:

$ export J2OBJC_HOME=/Users/bohan/j2objc-dist
$ ls -l $J2OBJC_HOME/j2objc

If it lists the j2objc command, then that's the right variable. If instead you get "ls: /Users/bohan/j2objc-dist: No such file or directory", then there's the problem. It has nothing to do with j2objc itself, but just how environment variables are used by the command-line and Xcode.

One important point is that Mac and Linux file systems are case-sensitive. Since few directories on those systems use names with all capital letters, the convention is to use all capitals for environment variables so it's easy to tell the difference at a glance. There is no directory called J2OBJC, it is j2objc. Unfortunately the default Mac filesystem allows case-insensitive matching, but it's a good habit to only refer to directories by their actual names, and not a case-insensitive version.

From your comment, my guess is that you built j2objc from source, and its top-level directory is /Users/bohan/j2objc/. If that's true, then the dist directory is under that root directory, in /Users/bohan/j2objc/dist (not j2objc-dist). If that's true, then the following is the right setting in Settings.xcconfig:

J2OBJC_HOME=/Users/bohan/j2objc/dist

@tomball tomball closed this as completed Dec 1, 2017
@tomball
Copy link
Collaborator

tomball commented Dec 1, 2017

The dist directory built by the j2objc build is in the j2objc project directory. If you cloned the j2objc source code to /Users/bohan/j2objc, then the right Settings.xcconfig line should be:

J2OBJC_HOME=/Users/bohan/j2objc/dist

@tomball
Copy link
Collaborator

tomball commented Dec 1, 2017

If you want to test the J2OBJC_HOME setting outside of Xcode, on the command-line run:

$ export J2OBJC_HOME=/Users/bohan/j2objc/dist
$ $J2OBJC_HOME/j2objc

You should see the usage message from the j2objc translator. If instead it says "No such file or directory", then export the correct J2OBJC_HOME value, test to verify, then copy that value to Settings.xcconfig.

@NikolBoh
Copy link
Author

NikolBoh commented Dec 2, 2017

Hi Tom! Thanks for answers! Reversi launched, all ok! At what from a USB disk - on USB has located files of the distribution kit j2objc and project files. Re-registered in Build installations. Reversi launched, all ok. But with my project something is not clear. Does not see the way to the libraries! What's the matter? I send screenshots of the settings.
screen3
screen2
screen1

@NikolBoh
Copy link
Author

NikolBoh commented Dec 2, 2017

What am I doing wrong:

  1. I downloaded and unzipped the release 2.0.5 (not the source).
  2. Created a new project in Xcode.
  3. Added to the project folder with classes of my project in Java /
  4. Set up in Build Settings (as in the screenshots).
  5. I started the project.
    What's wrong?

@NikolBoh
Copy link
Author

NikolBoh commented Dec 2, 2017

Or do I need to unpack the source code, put my project's directory there and run the myProject / make dist command through the terminal?

@NikolBoh
Copy link
Author

NikolBoh commented Dec 2, 2017

A little bit about yourself. I am 58 years old. 5 years ago I lost my job. In search of work I began to be engaged in programming. I created websites. But the competition is very big. This year I decided to get acquainted with the development for iPhone (the experience of 3 months of independent learning). A week ago, a company invited me for a probationary period. They want to adapt their Android applications to the iPhone. 11/27/2017 I found your program.
Therefore, please forgive me for idiotic questions.
And forgive me for my English.

@tomball
Copy link
Collaborator

tomball commented Dec 3, 2017 via email

@tomball
Copy link
Collaborator

tomball commented Dec 3, 2017 via email

@NikolBoh
Copy link
Author

NikolBoh commented Dec 3, 2017

Thanks for the answer! I did not expect a full translation from java to object c. But will the classes translate? And that's already a lot, I think. There is a starting point from where to start! Thanks for the link, be sure to get acquainted. (and the class translation continues in j2objc, 16 hours!)

@NikolBoh
Copy link
Author

NikolBoh commented Dec 3, 2017

Tom, I correctly understand that you recommend using JVM (Avian for example) to create a cross-platform. And re-write our application. Or can we move our application to the JVM? How critical is the clarity of the MCV data sharing scheme? (and the translation of classes in j2objc continues, 22 hours!)

@NikolBoh
Copy link
Author

NikolBoh commented Dec 3, 2017

There is an impression that Building libjre_emul.a 7 cycle does (?). This is normal?
protocol.txt

28 hours have already passed, and everything works and works. Building libjre_emul.a highlighted. So it should be? Wait when it's over?

@NikolBoh
Copy link
Author

NikolBoh commented Dec 4, 2017

Good afternoon Tom! 29 hours was a transfer and as a result issued:
"install: ../dist/lib/libjre_emul.a: Input / output error
make [1]: *** [../dist/lib/libjre_emul.a] Error 71
make: *** [jre_emul_dist] Error 2 "
What do these error codes mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants