Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Attachment for thread: new jar feature of XE7



Permlink Replies: 16 - Last Post: Feb 15, 2017 11:53 AM Last Post By: Alessandro Mart... Threads: [ Previous | Next ]
Borja Serrano

Posts: 172
Registered: 1/10/13
Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 7:15 AM
Attachment for thread: new jar feature of XE7
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 7:49 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Thank you very much!
As I see my usage of Java2op was wrong.
How did you create the Androidapi.JNI.Startioport.pas? I suppose from the starioport.jar?
I'm trying to recreate it but with the command:

java2op.exe -jar starioport.jar

I only get the error Class or Interface expected.
What paramters did you use?
I've tryid the classes parameter, but i'm not sure about the syntax.
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 7:52 AM   in response to: László Mlnvszky in response to: László Mlnvszky
Using the "StarIOPort.jar" that I have included in the project (from their webpage) I used javaop with the syntax:

java2op -jar StarIOPort.jar -unit Androidapi.JNI.Startioport

László Mlnvszky wrote:
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Thank you very much!
As I see my usage of Java2op was wrong.
How did you create the Androidapi.JNI.Startioport.pas? I suppose from the starioport.jar?
I'm trying to recreate it but with the command:

java2op.exe -jar starioport.jar

I only get the error Class or Interface expected.
What paramters did you use?
I've tryid the classes parameter, but i'm not sure about the syntax.

--
Borja Serrano
Embarcadero Technical Support Engineer
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 8:04 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Using the "StarIOPort.jar" that I have included in the project (from their webpage) I used javaop with the syntax:

java2op -jar StarIOPort.jar -unit Androidapi.JNI.Startioport

László Mlnvszky wrote:
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Thank you very much!
As I see my usage of Java2op was wrong.
How did you create the Androidapi.JNI.Startioport.pas? I suppose from the starioport.jar?
I'm trying to recreate it but with the command:

java2op.exe -jar starioport.jar

I only get the error Class or Interface expected.
What paramters did you use?
I've tryid the classes parameter, but i'm not sure about the syntax.

--
Borja Serrano
Embarcadero Technical Support Engineer

I've tried it, but it gives the same error:
"C:\Java2OP>java2op -jar StarIOPort.jar -unit Androidapi.JNI.Startioport
class or Interface expected
(I assume you misstyped it ...so)

C:\Java2OP>java2op -jar StarIOPort.jar -unit Androidapi.JNI.Starioport
class or Interface expected"

Maybe a version difference in our java2op or the JAVA JDK?
Or syntax?
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 8:09 AM   in response to: László Mlnvszky in response to: László Mlnvszky
There is only 1 version of java2op. MY JDK is:

C:\Program Files\Java\jdk1.7.0_25

And it could be the problem
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 8:15 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
There is only 1 version of java2op. MY JDK is:

C:\Program Files\Java\jdk1.7.0_25

And it could be the problem

Yes, I have the latest jdk 1.8.0.25 so I'm uninstalling it and installing the older one and see what happens. I'll give you feedback, it might be useful for your team.
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 9:00 AM   in response to: László Mlnvszky in response to: László Mlnvszky
László Mlnvszky wrote:
Borja Serrano wrote:
There is only 1 version of java2op. MY JDK is:

C:\Program Files\Java\jdk1.7.0_25

And it could be the problem

Yes, I have the latest jdk 1.8.0.25 so I'm uninstalling it and installing the older one and see what happens. I'll give you feedback, it might be useful for your team.

Well, i've installed JDK 1.7.0.25 from the Delphi DVD and it is the same.

java2op -jar StarIOPort.jar -unit Androidapi.JNI.Starioport
class or Interface expected

What could cause such an error?
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 9:18 AM   in response to: László Mlnvszky in response to: László Mlnvszky
Don't you have any other Java version in he machine? What do you get with the command "where javac"?

I get:

where javac
C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 9:27 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Don't you have any other Java version in he machine? What do you get with the command "where javac"?

I get:

where javac
C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe

I get the same back.
I'll try it on a different (clean-) computer tomorrow.
I guess i don't need delphi for this only JDK and java2op.exe
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 9:51 AM   in response to: László Mlnvszky in response to: László Mlnvszky
It seems that there are some issues with JDK 1.8 (https://quality.embarcadero.com/browse/AP-97)

On the other hand, I have just tested java2op in a new virtual machine without RAD Studio and with the current1.7 JDK (1.7.0_71) and it worked like a charm
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2014 11:35 PM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
It seems that there are some issues with JDK 1.8 (https://quality.embarcadero.com/browse/AP-97)

On the other hand, I have just tested java2op in a new virtual machine without RAD Studio and with the current1.7 JDK (1.7.0_71) and it worked like a charm

You are right, I've tried it on a different non-delphi machine and it really works. I guess installing the 1.8 JDK leaves some files behind (even though i've deleted the obvious folders).

Thank you very much for clearifying the Java2op usage.

If I May ask one more question.

How do you handle a result event?
I'm trying to use the zxing integrator too, and it has:

[JavaSignature('com/google/zxing/integration/android/IntentResult')]
JIntentResult = interface(JObject)
['{806E4218-ACC1-4F93-A16C-3F0B8FABE3A3}']
function getContents: JString; cdecl;
function getFormatName: JString; cdecl;
end;

TRegTypes.RegisterType('AndroidAPI.JNI.zxing-integration.JIntentResult', TypeInfo(AndroidAPI.JNI.zxing-integration.JIntentResult));

How do you trigger an event on the pascal/delphi side?
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 4:17 AM   in response to: László Mlnvszky in response to: László Mlnvszky
Hello, I have not tried it, but here you have a place to begin the investigation:

http://blog.blong.com/2014/09/delphi-and-nfc-on-android.html
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 8:08 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Hello, I have not tried it, but here you have a place to begin the investigation:

http://blog.blong.com/2014/09/delphi-and-nfc-on-android.html

Regarding the original, StarIOPort case, you exported androidapi.jni.starioport does not include some necessary files, which are included only as src\*.java
Can we implement java files directly to delphi?

Because with the Java2op.exe we can compile the src\*.java to a unit as a .pas, but as I suspect my original problem was that these units are not in the starioport.jar, that's why I got Javaclass not found errors.

So, in the SDK that .jar does not contain all the src\java files, can I use them in delphi, somehow?
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2016 12:37 AM   in response to: Borja Serrano in response to: Borja Serrano
Dear Borja Serrano!

I'm trying to compile the epson ePOS SDK, but i got the same error as last time: class or Interface expected.

Maybe it's the wrong JDK again, but i've tried it with a different computer with no luck.

Can you please translate the ePOS2.jar and the ePOSEasySelect.jar from the SDK for android for me?
https://download.epson-biz.com/modules/pos/index.php?page=single_soft&cid=4747&scat=50&pcat=52

That would be a big help for me, I'm really stuck with it!
Alessandro Mart...

Posts: 1
Registered: 7/9/00
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 11:53 AM   in response to: László Mlnvszky in response to: László Mlnvszky
László Mlnvszky wrote:
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Thank you very much!
As I see my usage of Java2op was wrong.
How did you create the Androidapi.JNI.Startioport.pas? I suppose from the starioport.jar?
I'm trying to recreate it but with the command:

java2op.exe -jar starioport.jar

I only get the error Class or Interface expected.
What paramters did you use?
I've tryid the classes parameter, but i'm not sure about the syntax.

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.
Auto Computers

Posts: 73
Registered: 7/8/05
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 3:49 AM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Can you do this for the Epson printer too?

https://download.epson-biz.com/modules/pos/index.php?page=soft&scat=50

Thanks
Godfrey
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Attachment for thread: new jar feature of XE7
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 4:12 AM   in response to: Auto Computers in response to: Auto Computers
Godfrey Fletcher wrote:
Borja Serrano wrote:
Attachment for thread: new jar feature of XE7

Can you do this for the Epson printer too?

https://download.epson-biz.com/modules/pos/index.php?page=soft&scat=50

Thanks
Godfrey

Hi GodFrey!

I've compiled the ePOS-Device.jar with a JAVA Bridge to androidapi.jni.epos.pas, drop me an email and i'll e-mail it to you.
I'm also interested in an EPSOn solution, i don't care if it's STAR or EPSOn, just be able to print, although STAR has mobile printers with battery, I couldn't find any EPSON printers like that, but they do have WIFI/bluetooth printers, so I guess this ePOS SDK can be a good solution.
laszlo at e-szoftver dot hu
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02