File.exists() does not work on mac for non-English characters on Java 7 on Mac

Paul Taylor paul_t100 at fastmail.fm
Thu Jan 24 08:08:41 PST 2013


On 24/01/2013 15:23, Steve Hannah wrote:
> You have to set JAVA_HOME before building .  I ran into the same problem.
Hi Steve

I have JAVA_HOME set, Im talking about building the appbundler itself 
not using it build my application because no jar is provided in the 
download.
However I've found that the class files are actually provided so I 
modified the package task in the build.xml file so that it doesnt depend 
on the compiler, this built the jar succesfully.
Then I could copy this into ants share folder and then I could use it to 
try and build my application

However I  found it doesn't like my existing build.xml complaining

java.lang.NullPointerException
     at com.oracle.appbundler.AppBundlerTask.copy(AppBundlerTask.java:692)
     at 
com.oracle.appbundler.AppBundlerTask.execute(AppBundlerTask.java:323)
     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     at org.apache.tools.ant.Task.perform(Task.java:348)
     at org.apache.tools.ant.Target.execute(Target.java:392)
     at 
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
     at 
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
     at org.apache.tools.ant.Main.runBuild(Main.java:795)
     at org.apache.tools.ant.Main.startAnt(Main.java:217)
     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

So it seems not compatible with the original appbundler, unless the 
problem is me running the package task without the compile task

Paul
> Steve
>
> On Thursday, January 24, 2013, Paul Taylor wrote:
>
>> On 22/01/2013 21:41, Steve Hannah wrote:
>>
>>> I just wanted to post my experiences with this bug.  I was having
>>> trouble on OS X in both 1.7.0u11 and 1.7.0u12 with Japanese file names
>>> (File.exists() erroneously returning false).
>>>
>>> Scott's fix for LC_CTYPE was the only thing that worked for me.
>>> (tried file.encoding=UTF8, and sun.jnu.encoding=UTF8 to no avail).
>>>
>>> As I am deploying to the Mac App store I needed to set this
>>> environment variable using the Info.plist file, and the current
>>> appbundler ant task didn't have an option to set arbitrary keys/values
>>> in the Info.plist, so I modified the appbundler source (I was actually
>>> working off of the infinitekind fork of appbundler at
>>> https://bitbucket.org/**infinitekind/appbundler<https://bitbucket.org/infinitekind/appbundler>)
>>> to automatically set
>>> the LSEnvironment key.
>>>
>> In case it helps Steves fix works if you add the following to Info.plist
>> once it has been created by AppBundler
>>
>> <key>LSEnvironment</key>
>> <dict>
>>     <key>LC_CTYPE</key>
>>     <string>UTF-8</string>
>> </dict>
>>
>> BTW I tried using infinitekind fork, but there doesn't seem to be a
>> prebuilt binary. I downloaded the source and ran ant
>> but it complained unable to find gcc. Fixing this is probably obvious to a
>> Mac developer but for a Java developer like myself whose main dev platform
>> is windows and just knows the minimum about macs
>>   to get by its a headache.
>>
>> Paul
>>
>>



More information about the macosx-port-dev mailing list