I'm using Delphi 10.1 Berlin
. I want to call Java codes from Delphi. So, I created JAR file in Android Studio
( this link helped to me). Then I opened Java2OP.exe
from C:\\Program Files (x86)\\Embarcadero\\Studio\\18.0\\bin\\converters\\java2op
directory. I moved the jar file to this directory. Then I worked this commands in CMD:
SET PATH=%PATH%;"C:\\Program Files\\Java\\jdk1.8.0_60\\bin"
Java2OP.exe -jar ..\\libmylib.jar -unit ..\\Androidapi.JNI.MyLib
But I get this error:
Warning: error opening ReservedWordsOP.txt
Warning: error opening ReservedWordsC.txt
Parsing xml: C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op\bootclasses.xml
Parsing jar: ..\libmylib.jar
class or Interface expected
This my Java class for JAR:
public class Test
{
public String work()
{
return "Hello World!";
}
}
Also I tried different Java codes, but result is same. How can I solve this problem?
I have the same problem, and solved it removing spaces from path files. Probably the Java2OP is calling the Java passing the path without quotes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.