Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve symbol error #2

Open
ken4ward opened this issue Jun 21, 2023 · 11 comments
Open

Cannot resolve symbol error #2

ken4ward opened this issue Jun 21, 2023 · 11 comments

Comments

@ken4ward
Copy link

I am trying to run your code and kept getting these errors
Cannot resolve symbol 'ALG_EC_FP' To the best of my knowledge, I think I have followed the README.md appropriately. Could you help direct me to what needs to be done.
Screenshot 2023-06-21 at 11 40 50 AM

@Muzosh
Copy link
Owner

Muzosh commented Jun 21, 2023

Hello, it seems that it can't resolve JavaCard Development Kit functions. These should have been downloaded by running the git submodule --init --update command.

If you look into 'build.xml' file, it adds dependency 'sdks/jc304something' which actually contain definitions for all symbols you can't resolve.

I have my mobile phone right now with me so I will be able to provide more help in couple of days. But until then, try to somehow ensure, this sdks/jc304 is properly included during the build.

@Muzosh
Copy link
Owner

Muzosh commented Jun 21, 2023

What command did you run when these errors occured?

If you haven't ran any commands, maybe it's just IntelliJ Idea's problem and you should somehow add the jc304.jar file yourself to the dependency list managed by IntelliJ.

@ken4ward
Copy link
Author

Thanks a lot for the prompt response. I have not run any command yet. I was just browsing though the code files. This is my first time checking out a JavaCard code. So everything is still a grey area to me. I'll update you accordingly as I progress.

@ken4ward
Copy link
Author

ken4ward commented Jun 21, 2023

Thank you. I have executed the first command, though it didn't resolve the issue. I tried the second command ant -f ./build.xml, and got this error. I suspect it's because the first command has not resolved the SDK dependencies.

Buildfile: /IdeaProjects/JavaCards/Electronic_passports_and_citizen_ID/InfinitEID/src/InfinitEID-applet/build.xml
      [cap] INFO: using JavaCard 3.0.4 SDK in /IdeaProjects/JavaCards/Electronic_passports_and_citizen_ID/InfinitEID/src/InfinitEID-applet/sdks/jc304_kit
      [cap] INFO: Setting package name to InfinitEID
      [cap] Building CAP with 1 applet from package InfinitEID (AID: 0102030405)
      [cap] InfinitEID.InfinitEIDApplet 0102030405060708
  [compile] Compiling files from /IdeaProjects/JavaCards/Electronic_passports_and_citizen_ID/InfinitEID/src/InfinitEID-applet/src/InfinitEID
  [compile] Compiling 1 source file to /var/folders/31/dlm5j_nn5958m8kyyhjcqd580000gn/T/jccpro11731244854021782265
  [compile] IdeaProjects/JavaCards/Electronic_passports_and_citizen_ID/InfinitEID/src/InfinitEID-applet/src/InfinitEID/InfinitEIDApplet.java
  [compile] error: Source option 6 is no longer supported. Use 7 or later.
  [compile] error: Target option 6 is no longer supported. Use 7 or later.

BUILD FAILED
/IdeaProjects/JavaCards/Electronic_passports_and_citizen_ID/InfinitEID/src/InfinitEID-applet/build.xml:4: Compile failed; see the compiler error output for details.

It is seeing the classes but not the called methods. It has 19 of such methods to resolve. This is an example.

Screenshot 2023-06-21 at 2 12 33 PM

@Muzosh
Copy link
Owner

Muzosh commented Jun 21, 2023

Seems like you are using newer version of either Ant or Maven. Try googling "error: Source option 6 is no longer supported. Use 7 or later.", this is your main problem here I think. As I said, I can't be much help until I get to computer.

@ken4ward
Copy link
Author

You're definitely right. I'm using the latest of both libraries. I'll be very grateful if you could support when on your computer. Your project is quite an interesting one.

@Muzosh
Copy link
Owner

Muzosh commented Jun 21, 2023

I will get to it in couple of days if that's ok.

@ken4ward
Copy link
Author

That's perfectly fine.

@Muzosh
Copy link
Owner

Muzosh commented Jun 24, 2023

Ok so I tried it myself and it seems like the problem is with JAVA_HOME environment variable -> it needs to point to a directory with Java 8 (maybe some other versions are possible as well, but Java 8 is tested).

So I recommend to install Java 8 version and use that, until I figure out, how to make this work with latest Java.

@Muzosh
Copy link
Owner

Muzosh commented Jun 24, 2023

The dependency for Java 8 comes from ant-javacard.jar file. From https://github.com/martinpaljak/ant-javacard#download--use:

Java version usable with all SDK-s is 1.8! Use SDK 3.0.5u3 and targetsdk to compile with Java 11 for older versions.

Since this project is using SDK 3.0.4, the only usable Java version is 1.8 (otherwise known as Java 8).

@Muzosh
Copy link
Owner

Muzosh commented Jun 24, 2023

https://github.com/martinpaljak/ant-javacard/wiki/JavaCard-SDK-and-JDK-version-compatibility

This is definitive source I can give you. According to this, it should also work with Java 11 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants