I am just starting out with XMP. I have read through the documentation, downloaded and reviewed the SDK, and read through numerous forum entries. The API looks great, but I was wondering why only 1/2 the solution is provided for Java Developers? To me the more important (and technically challenging I think) is the XMPFiles piece. Parsing XML, while tedious, is comparatively straighforward.
1. Does Adobe plan to provide a Java implementation of XMPFiles any time soon?
2. Are there any open source OR at cost Java libraries that provide the XMPFiles capabilities?
It is only the XMP Core part of the tool kit that is has been converted to Java. To my knowledge there is no plan to do this. And given the complexity of the XMP Files part, I don't think it will happen anytime soon.
I have no knowledge of any free or commercial Java versions of XMP Files.
If you want to use the XMP Tool Kit with Java, you have to make a JNI. It's not too hard. Here is the basic steps, there are differences between the platforms:
1. You need to make dynamic versions of the XMP Core and XMP Files. Duplicate the targets and make the required changes (5 or so I think)
2. Create a Java JNI project where you basically map the functions you need to access.
3. Create an Xcode projekt, where you include the C++ header you get from javah. Implement the C++ code to call the functions in the XMP Toolkit. You can choose the you make it static link the dynamic XMP libs into the JNI. If you don't you need to make sure that your JVM also has access to the dynamic XMP libs (this makes it harder to distribute and maintain)
1. You need to make static versions of the XMP Core and XMP Files with settings a DLL, ie. all settings but the one that defines the final format need to match a DLL
2. Create a Java JNI project where you basically map the functions you need to access (you can use the same project for both Mac og PC).
3. Create a VS project, where you include the C++ header you get from javah. Implement the C++ code to call the functions in the XMP Toolkit. The JNI is a DLL but the XMP Core. Supplying all three as DLLs to the JVM is possible, but you will need to make some changes to the XMP Toolkit (or at least I had to when I tried, so I decided to not go that way - I think I read somewhere that someone had done this)
It is also possible to create a Linux version, if you require this, You can use the Mac code with a few adjustments.
Creatting 64-bit versions is possible, but on the PC you get a few warnings about indexs that will be chopped from 64-bit to 32-bit, so use these with caution.
Hi T Schneider,
I've got the same requirement as Brruce and about to start developing the JNI code... The only question I've got about your answer is concerning this sentence:
You need to make dynamic versions of the XMP Core and XMP Files. Duplicate the targets and make the required changes (5 or so I think)
What does that exactly mean?
I guess I can figure out the rest.
In XCode you duplicate the static release targets. Then you edit the build settings to make it build a dynamic library. If you are not sure which settings need to be change, create a dynamic lib from the template and compare the build settings.
When trying to build it, I get the following error.... I needed to change the MacOS sdk as i'm in 10.6:
i686-apple-darwin10-llvm-gcc-4.2: /Users/myuser/Projects/clients/the_client/XMP-Toolkit-SDK-5.1.2/build /xcode3/../../source/XMPCore/../../third-party/expat/lib/xmlparse.c: No such file or directory
i686-apple-darwin10-llvm-gcc-4.2: warning: '-x c' after last input file has no effect
i686-apple-darwin10-llvm-gcc-4.2: no input files
Command /Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
I guess it is because of the "../.." of the paths.... but I wonder if it's just me getting that error...
I think your are missing something (hit: you have to install 3-party software yourself). Make sure that you can build and run the tests in the SDK Toolkit, before making changes. I can also see, that you are using v4.2 of gcc. I would consider using v4.0 and building against the OS X 10.5 SDK instead.
Has anyone succeeded in making the JNI library work? I need to do the same thing and would be happy to help or contribute as I can. I'd be happy to set up an open-source project to serve the result if that's appropriate.
RSI Content Solutions, rsicms.com