Print at Dec 31, 2025, 8:27:52 PM
Posted by enkonyito at Nov 10, 2019, 5:18:07 PM
How to generate a .h file with javah?
In the YafarayRenderer.java file of the new plugin , there is the procedure to generate the YafarayRenderer.h file.

By replacing the initial packages with that of the PhotoVideoRendering plugin, I get this error message:
Error: Could not find class file for 'betaTest_plugin.YafarayRenderer'.


Enko
----------------------------------------
EnkoNyito

Posted by Puybaret at Nov 15, 2019, 6:38:17 PM
Re: How to generate a .h file with javah?
To generate a .h file, you have to compile first the class which contains native methods, and add the path of the compiled class to the classpath used by javah.
Have a look to the comment of loadDLLs method in YafarayRenderer class to get more ideas.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by enkonyito at Nov 16, 2019, 2:51:06 AM
Re: How to generate a .h file with javah?
Thank you Emmanuel!

Based also on this documentation, I was able to generate the YafarayRenderer.h file in the plugin package.
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class betaTestPlugin_YafarayRenderer */

#ifndef _Included_betaTestPlugin_YafarayRenderer
#define _Included_betaTestPlugin_YafarayRenderer
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: betaTestPlugin_YafarayRenderer
* Method: createEnvironment
* Signature: (Ljava/lang/String;Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_betaTestPlugin_YafarayRenderer_createEnvironment
(JNIEnv *, jobject, jstring, jstring);


Since I don't know JNI, generating DLLs is less obvious and I get an error in Eclipse when rendering.

It's easier with the modified YafaRay rendering plugin because I kept your packages and added the necessary files and folders.
----------------------------------------
EnkoNyito