Failure to call the j2objc command after installation

33 views
Skip to first unread message

hydrolythe

unread,
Dec 11, 2020, 7:57:53 AM12/11/20
to j2objc-discuss
I managed to install the j2objc command by building it from the source with "man dist". In spite of that I get a "Command not found" error when I ask for the j2objc command. 

I don't know how relevant this is, but when I run "make test" to run unit tests 9 of them failed. Here are the messages: 

1) testRfc2109Response(libcore.java.net.CookiesTest)

junit.framework.ComparisonFailure: expected:<[Air-van-G]uylian.localdomain> but was:<[air-van-g]uylian.localdomain>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108955c9e junit.framework.ComparisonFailure.<init>() + 24

at 0x0000000108954681 junit.framework.Assert.assertEquals() + 91

at 0x00000001089ded09 libcore.java.net.AbstractCookiesTest.testRfc2109Response() + 1017

2) testRfc2965Response(libcore.java.net.CookiesTest)

junit.framework.ComparisonFailure: expected:<[Air-van-G]uylian.localdomain> but was:<[air-van-g]uylian.localdomain>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108955c9e junit.framework.ComparisonFailure.<init>() + 24

at 0x0000000108954681 junit.framework.Assert.assertEquals() + 91

at 0x00000001089df20e libcore.java.net.AbstractCookiesTest.testRfc2965Response() + 1134

3) testQuotedAttributeValues(libcore.java.net.CookiesTest)

junit.framework.ComparisonFailure: expected:<[Air-van-G]uylian.localdomain> but was:<[air-van-g]uylian.localdomain>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108955c9e junit.framework.ComparisonFailure.<init>() + 24

at 0x0000000108954681 junit.framework.Assert.assertEquals() + 91

at 0x00000001089df7ae libcore.java.net.AbstractCookiesTest.testQuotedAttributeValues() + 1134

4) testNetscapeResponse(libcore.java.net.CookiesTest)

junit.framework.ComparisonFailure: expected:<[Air-van-G]uylian.localdomain> but was:<[air-van-g]uylian.localdomain>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108955c9e junit.framework.ComparisonFailure.<init>() + 24

at 0x0000000108954681 junit.framework.Assert.assertEquals() + 91

at 0x00000001089de733 libcore.java.net.AbstractCookiesTest.testNetscapeResponse() + 1011

5) testRedirectToAnotherOriginServer(libcore.java.net.URLConnectionTest)

junit.framework.AssertionFailedError: [Host: air-van-guylian.localdomain:51461, Accept: */*, Accept-Language: nl-be, Connection: keep-alive, Accept-Encoding: gzip, deflate, User-Agent: jre_unit_tests (unknown version) CFNetwork/1207.2 Darwin/20.1.0]

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108954570 junit.framework.Assert.fail() + 27

at 0x00000001089544e8 junit.framework.Assert.assertTrue() + 0

at 0x0000000109224ef3 libcore.java.net.URLConnectionTest.assertContains() + 115

at 0x0000000109227795 libcore.java.net.URLConnectionTest.testRedirectToAnotherOriginServer() + 1589

6) test_ru_RU(libcore.libcore.icu.LocaleDataTest)

junit.framework.ComparisonFailure: expected:<[в]с> but was:<[В]с>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108955c9e junit.framework.ComparisonFailure.<init>() + 24

at 0x0000000108954681 junit.framework.Assert.assertEquals() + 91

at 0x00000001093d04bf libcore.libcore.icu.LocaleDataTest.test_ru_RU() + 639

7) test_getType_I(org.apache.harmony.tests.java.lang.CharacterTest)

junit.framework.AssertionFailedError

at 0x0000000108954563 junit.framework.Assert.fail() + 14

at 0x0000000108954508 junit.framework.Assert.assertFalse() + 0

at 0x0000000109506b5c org.apache.harmony.tests.java.lang.CharacterTest.test_getType_I() + 364

8) test_isDefined_I(org.apache.harmony.tests.java.lang.CharacterTest)

junit.framework.AssertionFailedError

at 0x0000000108954563 junit.framework.Assert.fail() + 14

at 0x0000000108954549 junit.framework.Assert.fail() + 0

at 0x000000010950730c org.apache.harmony.tests.java.lang.CharacterTest.test_isDefined_I() + 108

9) test_isDirectionaliy_I(org.apache.harmony.tests.java.lang.CharacterTest)

junit.framework.AssertionFailedError: expected:<-1> but was:<0>

at 0x0000000108189f30 java.lang.AssertionError.<init>() + 35

at 0x0000000108954570 junit.framework.Assert.fail() + 27

at 0x0000000108954ec2 junit.framework.Assert.format() + 0

at 0x00000001089545ef junit.framework.Assert.assertEquals() + 0

at 0x0000000109509e0e org.apache.harmony.tests.java.lang.CharacterTest.test_isDirectionaliy_I() + 62

Tom Ball

unread,
Dec 11, 2020, 12:51:27 PM12/11/20
to j2objc-discuss
I managed to install the j2objc command by building it from the source with "man dist". In spite of that I get a "Command not found" error when I ask for the j2objc command. 

If by "ask for the j2objc command" you mean you want to just type "j2objc" in a Terminal window or reference "j2objc" in an Xcode build rule, then you need to add a path to your build's "dist" directory. For example, if you cloned the j2objc repository into a local "/foo/bar/j2objc" directory, then "/foo/bar/j2objc/dist" needs to be added to your PATH environment variable. 

Here's a tutorial on how to add a path. Please note that this doesn't change any existing app settings, only future ones. So for Terminal use, open a new Terminal window. Apps like Xcode use the path read when the system started, so you'll need to restart your system to update that path.

... when I run "make test" to run unit tests 9 of them failed.

Please file an issue, specifying what version of j2objc is having the problem (just say "current" if you are testing with a build from the latest source), as well as the MacOSX and Xcode versions your system has installed. New OS or SDK versions frequently introduce new test failures, especially tests related to internationalization/localization or networking since those features change frequently.

--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/a27b8e5b-3b9a-41ba-8260-b0d782d4036en%40googlegroups.com.

hydrolythe

unread,
Dec 11, 2020, 1:54:18 PM12/11/20
to j2objc-discuss
Thank you Tom Ball. I did add the path for j2objc and it ended up working for me. 
Reply all
Reply to author
Forward
0 new messages