|
Hi Saravana I am also interested in JAVA card. You can opt for any training centers to learn java card.
|
|
|
|
|
Hiii
There are a lot of ways to learn Java card
First I got difficulty to learn java card then I research for a best way to learn java
then I found website like hackr & javascript they help to get mastery on javascript
|
|
|
|
|
Hi, After I create a dll file for a project (I tested it and it is working), can I use the same DLL file in a different project simply by adding it in the files (ofc changing the path from System.load in java)?
Edit: I'm asking because I tried it, but I get "UnsatisfiedLinkError" when I'm using a dll made from a different project, BUT with the exact same code. Or I need to add something to make it be usable in multiple project?
modified 9-Jun-18 16:40pm.
|
|
|
|
|
Yes. And a s simple test would have given you the answer.
|
|
|
|
|
When you were answering I was editing my post. I crated 2 dll files, and they only work in the project that the header file was created.
|
|
|
|
|
The error message just means that you are trying to reference a method in the dll that does not exist.
|
|
|
|
|
Here are the projects, and you can see that they are 99% the same, only 1 character differs.
Link to projects Google Drive
The C function adds the minimize event back to the window for undecorated stage.
Test1Minimize.dll was made from Test1_Test1Minimize.h and Test2Minimize.dll was made from Test2_Test2Minimize.h. And only the dll Test1Minimize.dll works only on Test1 project, and Test2Minimize.dll works only on Test2 project.
|
|
|
|
|
Most people will not go to a site to look at your code.
First, using a native library in Java is dangerous. It is not something I will ever do again because if the native library fails it causes the VM to exit and that is not viable in server developer. You can achieve the same functionality using an external executable and accessing via any number of methods such as stdin/out, files, sockets or even running it as a true service (http, rest, etc)
Second the requirement for a accessing a native library in java
1. The native library must be loaded into the VM
2. The definition must match EXACTLY with the expected classes in the native library. Changes to packages, methods, parameters, access, etc, all require regenerating the api, recompiling and building a new native library.
It is possible to validate that a native library loads (1 above) and this should ALWAYS be verified. Methods should be wrapped in a proxy class so that that mismatches (2) can be captured an properly reported as being mismatches.
Valentinor wrote: only 1 character differs.
Nothing can be different.
|
|
|
|
|
jschell wrote: Most people will not go to a site to look at your code.
Yeah, I know, but this time, there was a lot of code to show, so I decided to post it in case someone is interested in.
jschell wrote: 2. The definition must match EXACTLY with the expected classes in the native library. Changes to packages, methods, parameters, access, etc, all require regenerating the api, recompiling and building a new native library.
I thought this is the problem, after all, C source code was the same in both cases, only the header file was different, which was generated based on the class from java.
jschell wrote: You can achieve the same functionality using an external executable and accessing via any number of methods such as stdin/out, files, sockets or even running it as a true service (http, rest, etc)
This can be a good alternative, tho I would have to make sure that the external executable finished what was supposed to do, before Java continues with the rest of the code.
jschell wrote: It is possible to validate that a native library loads (1 above) and this should ALWAYS be verified. Methods should be wrapped in a proxy class so that that mismatches (2) can be captured an properly reported as being mismatches.
Yeah, that would be a mistake not to do, and I'm sure quite a few times it is made, being from laziness or a different reason.
Thanks for your response.
|
|
|
|
|
Hi, When I'm trying to create a header file (using javac -h . ClassName.java), I have 2 problems.
1: I get an error that there are some unmappable character for encoding Cp1250, but I think this problem I solved it by adding -encoding utf8 at the end;
2: I have more then 1 package and because of this I get the following error for every usage of a class that is in a different package.
ClassName.java:lineNumber: error: cannot find symbol
function header
symbol: variable TheNameOfTheVariable
location: class TheNameOfTheClass
The first problem I think it is solved by adding that at the end, but I don't know what to do for the 2nd problem. Any suggestions?
modified 9-Jun-18 16:42pm.
|
|
|
|
|
Do you mean using javap? And without seeing some code and the actual output, it is impossible to guess.
|
|
|
|
|
I said "javac -h" to create a header file, so I can create the DLL in C.
public class TestMain extends Application {
static {
System.load(System.getProperty("user.dir") + "\\Data\\Example.dll");
}
private native void doSomething();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
Class1 example1 = new Class1();
Class2 example2 = new Class2();
doSomething();
arg0.setScene(new Scene(new Pane()));
arg0.show();
}
}
Class1 and Class2 only have the constructor in them. Also they are in "\Example\src\NewPackage" compared to the TestMain which is in "\Example\src\Test".
Here is the command output:
Link to image
|
|
|
|
|
By using javac -cp "Path To src Folder" I don't get that error anymore, but now, even tho the classes are saved as UTF-8, and that I added -encoding utf8 (I tried -encoding utf-8 too), I still get "error: unmappable character for encoding utf-8"
|
|
|
|
|
There must be some strange characters still in your source files.
|
|
|
|
|
I just did a test with the same characters in another project, and I don't have that problem, it is really strange. Oh well, I'll figure it out in time.
|
|
|
|
|
There must be a character in there somewhere that is not getting displayed. Use a hex editor to find it.
|
|
|
|
|
The problem was from Eclipse. I had to remove those characters and then add them again. For some reason it wasn't recognizing then anymore and was adding some weird characters instead in the files.
|
|
|
|
|
So, the solution was to add:
-cp "The location of src folder" (you need the " ")
-encoding utf8
|
|
|
|
|
I am doing a project in java that requires to detect the number of fingers in the image
I want to know how to do that or sample code for this task .
|
|
|
|
|
Google for "Java image recognition".
|
|
|
|
|
i had starting learning java one month age but till now i dont think i had gain even 1% of knowledge please help
|
|
|
|
|
|
Hi,
I'm in a full stack training program and we are currently working on an inter-team project comprised of RESTful services in a microservice architecture. I've been put in charge of back-end unit testing for and am currently researching various test APIs. In addition to JUnit, I'm trying to determine whether I should use REST-assured, Mockito, or both. Reading through the documentation and reading/watching various tutorials has been a bit confusing though. My understanding so far is that REST Assured is for endpoint testing and Mockito is for unit testing. Can someone please give advice as to which would be better to use, or should I be using them both?
Basically, it would be for testing basic CRUD functionality in Spring MVC apps on the service and controller layers.
Any help or advice is greatly appreciated! Also, I can provide more information if you want, I realize it's kind of an open-ended question.
|
|
|
|
|
|
This is the Java forum. What language is that code in your picture?
|
|
|
|