How to compile java code with swift in XCode
<p>I use J2Objc by Xcode build rules in Xcode(swift).</p>

<ol>
<li><p>Write a java file(People.java)
2.make settings for build rules, and add the custom script as the following:</p>

<p>"${J2OBJC_HOME}/j2objc" -d  ${DERIVED_FILES_DIR} -sourcepath     "${PROJECT_DIR}/iOSApp-Swift" --no-package-directories  <strong>-use-arc</strong> ${INPUT_FILE_PATH};</p></li>
</ol>

<p>Note: i enable the ARC</p>

<ol start="3">
<li>add the bridging-header file and import People.h file.</li>
<li>call some function from People class in viewcontroller file.</li>
</ol>

<p>When I build the project ,failed:'People.h not found'.</p>

<p>And When i build before importing and using the People.h, then implement to import People.h file and  calling some function from People class in viewcontroller file, and build the project. It works.</p>

<p>I think the problem caused by J2objc not convert java file to .h/.m file before build the bridging-header file. Who knows how to fix it?</p>

<p>Thanks</p>