JBuilder: JNI-Problem

Status
Nicht offen für weitere Antworten.
K

knopper

Gast
Hallo,

Nach erfolgreichen Erstellen und Kompilieren von h, cpp file in VC++, habe ich mit Myclass.class die Myclass.dll getestet.
Es funktioniert alles so weit. Nun habe ich Myclass.java und Myclass.dll in meinem JBuilder Projekt eingefügt. Aber beim Kompilieren bekomme ich immer diese Fehlermeldung.

java.lang.UnsatisfiedLinkError: get_method
at mypackage.Myclass.get_method(Native Method)
at mypackage.Myclass.main(mypackage.java:210)


Die Datei dll ist in allen nötigen Verzeichniss kopiert.
Das Problem ist ich muss im Myclass.java Header die Zeile package mypackage reinschreiben.
Hat jemand eine Idee wie ich das Lösen kann ? Und das mit JBuilder.

Gruss
 

Pulvertoastman

Bekanntes Mitglied
Deutet aber dennoch darauf hin, dass die DLL nicht gefunden wurde.

Vielleicht findest du hier noch ein paar Anregungen:
ttp://www.krucker.ch/Skripten-Uebungen/InfUeb/InfUeb.html
 
K

knopper

Gast
Hi Pulvertoastman,
Danke füe die hilfreiche Link.
Ich kann das Beispiel durchführen ,aber beim Selbstertellen meiner JNI an Hand der Beschreibung stosse ich immer auf die genannte Fehlermeldung.
Ich habe dann auch nur ganz einfache Hello Klasse eingebunden, doch funzts im JBuilder nach wie vor nicht. Mit Eclipse das gleiche Resultat. Das ist wie verhext !
Es wäre nett wenn jemand von Euchauf den Fehler hinweisen kann ! oder mal step by step probieren, ob Ihr auch den selben Fehler habt wie ich habe.

Gruss
 

Pulvertoastman

Bekanntes Mitglied
Mir fällt gerade auf, dass du ja Fuschel C++ verwendest.


Hier kann es sein, dass du zwar eine DLL erstellt hast, diese aber keine Symbole exportiert, weil Microsoft das nämlich wieder mal alles ganz anders macht.

Achte darauf, dass deine Methoden auch exportiert werden mit

Code:
#define JNIEXPORT __declspec(dllexport)
#define JNICALL __stdcall
 
K

knopper

Gast
Hi,
nun den beiden Zeilen hinzugefügt:

Code:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Hello*/

#ifndef _Included_Hello
#define _Included_Hello

#define JNIEXPORT __declspec(dllexport)
#define JNICALL __stdcall

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     Hello
 * Method:    hello
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_Hello_hello
  (JNIEnv *, jclass);

#ifdef __cplusplus
}
#endif
#endif


Die Exportdatei heisst aber " ic.dll " ( Unterschiedliche Name erlaubt oder ? ).

Die Fehlermeldung:

java.lang.UnsatisfiedLinkError: hello
at netmaneger.NetManager.hello(Native Method)
at netmaneger.NetManager.main(MipClientManager.java:262)


Wie gesagt, wenn ich eine Java datei selbst schreibe und dann kompieliert dann funktioniert das ganze.
 
K

knopper

Gast
Hi Leute,

Es liegt wohl an JBuilder, dass JBuilder VC++ dll file nicht vertägt.
Andere Leute hat es auch bestätigt.
Nun arbeite ich mit Eclipse und es funktioniert :)

MfG
 
C

centrino

Gast
Hallo,

Ich ein Problem mit JNI .

Wenn ich eine .h datei aus einer Klasse erstelle, und dll datei bildet, funktioniert das ganze.
Aber wenn ich mein Projekt mit eine Package einpacke, dann bekomme immer den Fehler:

java.lang.UnsatisfiedLinkError: hello
at Mypackage.MyClass.hello(Native Method)
at Mypackage.MyClass.main(MipClientManager.java:514)

Wie kann ich nun die richtigen h Datei erstellen ?

Gruss
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
L Jbuilder Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
J jbuilder 2005 foundation problem mit parameterinsight IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
G kleine frage zu JBuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
T JBuilder und Packages IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
B JBuilder 2005 - Consolenausgabe erweitern IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
S Projekt-VCS im Jbuilder 2006 wechseln IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
M Borland (JBuilder) Klassenbibliothek nutzen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
T Wie exportiere ich ein Programm aus dem JBuilder? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M JBuilder und Zeilenumbruch IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S Packege unter Eclipse und jBuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
P JBuilder exe & co . aber wo IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
F JBuilder 2005 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
D JBuilder und Konsole IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
L-ectron-X JBuilder vs. Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 21
G JBuilder Jar File machen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S Borland JBuilder: .class bzw. .jar erstellen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
Bleiglanz JBuilder - die gute alte Zeit IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
B JBuilder-Designer schmiert bei SWT.text.... ab ! IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
O JBuilder startet nicht (Suse Linux) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G JBuilder 2005 Foundation kostenlos? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
S Probleme mit manchen Zeichen in Jbuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
O JBuilder Formatierung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G JBuilder 2005 Frage IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
B JBuilder Enterprise 2005 für J2EE IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
thE_29 JBuilder nervt mal wieder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
J eclipse & JBuilder = Probleme IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
J JBuilder Fat32 und NTFS IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
W JBuilder ein Greuel wegen Langsamkeit? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 19
R Wie erstellt man JAR-Dateien unter JBuilder 2005 Foundation? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
S JBuilder: Größe von Buttons ändern IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
M JBuilder Designer findet Klasse nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
C JBuilder Personal kommerziell? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
Q Frage zu Borland JBuilder 2005 Foundation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
R JBuilder 2005 Foundation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
M In JBuilder Klasse generieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
G Libraries unter JBuilder X IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
M JBuilder X: Absturz nach Scrollen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
T JSF mit JBuilder 2005 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
T JBuilder X und Tiger IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N JBuilder X für Linux: keine Quelltextanzeige mehr IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
A Swing-GUI-Builder: JBuilder, NetBeans oder Visual Editor? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
H JBuilder: Javadoc-Erzeugung unterbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A Netbeans oder JBuilder .oder ? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
G jBuilder und Code-Formatierung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
F JBuilder (9 Personal) - Probleme mit Klassen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C JBuilder: Packages schachteln IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
M Debugging-Fehler mit JBuilder 9 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G JBuilder: Applikationen starten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
P Probleme mit JBuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
R JBuilder erkennt GUI nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A [JBuilder] - Keine Hilfe vorhanden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
E JBuilder aktualisieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
B Eclipse vs JBuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 43
G JBuilder unter Debian Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C JBuilder "slowdown" IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
G Aus Jbuilder projekt exe datei machen??? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
G jbuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
M JBuilder 9 Help File!? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
R Wie erstelle ich Packete unter JBuilder? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 16
N JBuilder und Variablendeklaration IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
C JBuilder Fehlermeldung IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
S JBuilder 9 Personal IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
MamaMia44 Ich habe problem mit Intelej Idea IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
U Problem mit Eclipse - WindowBuilder - memoryLeak? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 15
K Java Editor Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
B Eclipse Problem mit jar Datei? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Robertop Eclipse EXE Icon fehlt im Explorer (Windows Problem?) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
B Problem bei der Ausgabe IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
melaniemueller Eclipse Problem mit dem Debugger IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S Problem mit BlueJ IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
1 Problem beim JavaFX installieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
Splayfer Problem mit der Eclipse Autovervollständigung... IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
R Eclipse Cursor Problem bei Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
D Jenkins/Gradle maven-publish Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
F Eclipse Problem mit Aufhänger bei verschiedenen Prozessen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
H Selenium Problem mit Browsern IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
P Problem accessing /rap. Reason: ProxyServlet: /rap IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
V Eclipse:Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
P Eclipse Luna SR2 (4.4.2)- Problem bei hinzufügen von Software IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Eclipse Eclipse-Problem unter Debian IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Tarrew Problem mit Maven und der Erkennung von generierten Antlr Files. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
F Egit-Problem nach Merge-Konflikt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Y GIT remote Problem keine Synchronisation IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
N NetBeans Javadoc Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M NetBeans und UTF8 Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
E Eclipse Eclipse building workspace Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
fLooojava Eclipse Problem mit Template proposals IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M NetBeans Problem mit eMail Programm IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 11
R Eclipse Problem beim Export als Executable Jar IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S Problem mit Git IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
V Eclipse Eclipse Problem beim erstellen einer JAR IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse JavaEE IDE Problem mit Servlets IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse Problem mit Mac und Windows IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
B Eclipse SVN Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M Eclipse Problem beim Projektimport mit user libraries IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Eclipse 'refreshing external folders' has encountered a problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
H NetBeans Export Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
A gdal problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
D Eclipse Autocomplete Problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
M IDEA IntelliJ Subversion connection problem IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3

Ähnliche Java Themen

Neue Themen


Oben