hello all friends i need your help in java.library.path setting.i use a TPM/j API to develop an application using Trusted Platform Module (TPM) specification and to use TPM/j API i need to set java.library.path and load TBSProxy.dll. I try to set java.library.path using DOS and it not works.

C:\Users\lfgs\tpm\tpmj>java -Djava.library.path=C:\Users\lfgs\tpm\tpmj\lib\ TBSProxy.dll

and it return java.lang.NoClassDefFoundError

is there any error in my coding/syntax?

and then i use netbeans and execute java file with the contents

System.setProperty("java.library.path", "C:\Users\lfgs\tpm\tpmj\lib");
System.loadLibrary("TBSProxy.dll");

and this also didnt work. any java expert please correct me if i've make mistakes in the syntax.my program cannot execute when i fail to load the TBSProxy.dll files

thanks for any help

Recommended Answers

All 6 Replies

hello all friends i need your help in java.library.path setting.i use a TPM/j API to develop an application using Trusted Platform Module (TPM) specification and to use TPM/j API i need to set java.library.path and load TBSProxy.dll. I try to set java.library.path using DOS and it not works.

C:\Users\lfgs\tpm\tpmj>java -Djava.library.path=C:\Users\lfgs\tpm\tpmj\lib\ TBSProxy.dll

and it return java.lang.NoClassDefFoundError

is there any error in my coding/syntax?

What's with that space after the last "\"? And which class/jar are you attempting to execute?

and then i use netbeans and execute java file with the contents

System.setProperty("java.library.path", "C:\Users\lfgs\tpm\tpmj\lib");
System.loadLibrary("TBSProxy.dll");

and this also didnt work. any java expert please correct me if i've make mistakes in the syntax.my program cannot execute when i fail to load the TBSProxy.dll files

thanks for any help

Well, this can't work. This option must be set from outside the program. This option is available inside the program only for information.

What's with that space after the last "\"? And which class/jar are you attempting to execute?

i ever try to write without the space but it did not work.i didnt know whether dll file can be set up to java library path using this way.i also ever try to write it without the TBSProxy.dll.below is the manual on how to set TBSProxy.dll from TPM/j API user guide and actually im not really understand what it means.or u can view the full user manual at this link http://projects.csail.mit.edu/tc/tpmj/UsersGuide.html.

hope you can help me to understand it.thanks.

Thomas Müller (xnos.org) has contributed code for using TPM/J under Windows Vista using the TDDL-like interface of the TBS. To use this, you need to have the TBSProxy.dll file in the lib directory of the TPM/J distribution. Thus, as with Windows XP above, you have to run Java with the -D option pointing java.library.path to the lib directory. e.g.,
java -Djava.library.path=C:\TPMJ\lib ...

i ever try to write without the space but it did not work.i didnt know whether dll file can be set up to java library path using this way.i also ever try to write it without the TBSProxy.dll.below is the manual on how to set TBSProxy.dll from TPM/j API user guide and actually im not really understand what it means.or u can view the full user manual at this link http://projects.csail.mit.edu/tc/tpmj/UsersGuide.html.

hope you can help me to understand it.thanks.

The "command" shown at the end of that quote is only a partial command, showing you what you need to add to the command that you usually use.

You need to create a new run configuration for your project to add that argument to any execution you do from NetBeans (I know it is done from the "Run" menu, but I don't, currently, have a NetBeans in front of me so I cannot describe the process).

The "command" shown at the end of that quote is only a partial command, showing you what you need to add to the command that you usually use.

You need to create a new run configuration for your project to add that argument to any execution you do from NetBeans (I know it is done from the "Run" menu, but I don't, currently, have a NetBeans in front of me so I cannot describe the process).

because it partial command so im not really know how to write full command.erm thats mean i need to write the command in a java class and run the file in netbeans using the command in DOS (which convert to proper java programming) instead of using setProperty()?

No, it means you need to define a new run configuration for your project and include that "-D" option in that run configuration! As I already said.

My God, this is exactly why you should not learn Java (or any language) using an IDE. You haven't got the first clue what you are doing. You should learn the language using a simple text editor (with syntax highlighting, maybe) and the command line. Than, at least, you would learn what the command consists of, what the arguments are, both VM and program arguments (which are two different things), and learn what the classpath, library path, and path are (all of which are different things), and learn how to use them.

wow thats true what you say.initially my lecturer teach me to write java programming using textpad, not using notepad. i think i must learn back the basic.i used IDE for a long time and maybe it makes me not go through hard way in compiling and executing.thanks for your advice.i will try to learn again =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.