on 10-12-2006 8:06 AM
I want to change the java.library.path property of VM permanently, thus I used the java command with -D option just like below, with no new-line entered:
java -Djava.library.path=/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:/usr/sap/XID/SYS/exe/run:/usr/sap/XID/SYS/exe/runU:/db2/db2xid/sqllib/lib:/usr/lib:/opt/IBM/cicstg/bin
but after doing this, the following infomations appears in console, just like I've just enter "java":
Usage: java [-options] class [args...]
(to execute a class)
or java [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by 😆
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
-assert print help on assert options
And the last path - /opt/IBM/cicstg/bin still hasn't been added to java.library.path property.
Any ideas? Thanks!
Hi YiNing,
Other way for setting java path:
Right click on MyComputer->Advanced->Environment variable
JAVA_HOME=c:\j2sdk1.4.2_11
PATH=%JAVA_HOME%\bin;<remaining path>
Regards, Suresh KB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suresh, I tried your method in windows but it doesn't work.
I write a java code to get the java.library.path property.
import java.util.Properties;
class GetProperty
{
public static void main(String[] args)
{
Properties props = System.getProperties();
System.out.println(props.getProperty("java.library.path"));
}
}
Besides, our system is AIX UNIX, and I've add the path to LD_LIBRARY_PATH, but still, I can't seen it in java.library.path:(
Hi,
how to change / update the java options is documented in SAP note 710146, which basically says :
go to something like
C:\usr\sap\<id>\<instance>\j2ee\configtool,
start the configtool.bat (.sh on unix), select
cluster_data/instance_ID.../server_ID... and make the change in the "Java parameters" field. Do this for all servers and dispatchers, click the save button and restart the whole cluster
However modifying the library path of the whole java and the server, may lead to some quite strange results, and I assume you want to make your dll available only for some application, right ? So maybe a better approach is to package your resources together with your application and deploy, although I am not sure how or if that could be done with native libraries.
Probably search in the documentation or opening another message with appropriate subject may help.
HTH
Peter
Hi,
So there are some native libraries used by the IBM guys, but they cannot be loaded ?
I don't have any JNI experience, but maybe if the native resources used by the IBM code is in the classpath, that will do the trick... and simply adding this to the application (at the root level, without package) is something that could be tried...
Or perhaps deploying the IBM jars and their resources as a library on the server and using them from your application...
Here is a thread that discusses server libraries and somewhat similar problem,
HTH
Peter
Peter, the library files is generated with the installation of a IBM product.
Unfortunely, we forgot to use ther user <sid>adm to install the product, thus, some system environment is not set properly, and java.library.path is one of them.
I've theck the configtool, the setting in it is a command line, and -Djava.library.path can be added to there, but as you said, it's dangerous, so I haven't tried it.
Anyway, thank you:)
My last question is, still as the first one, <b>why can't I use java -D option in console? Even in my windows console?</b>
Hi,
the java -D options is NOT to setup something permanently as it seems you are expecting, but to set something for the current invocation. The message you get is that you need to provide a class with main method together with the launch options. I.e. if you invoke
java -Djava.library.path=myPath GetProperty
where GetProperty is your class you should see the correct value, but if you launch it the next time :
java GetProperty
you should see again the old value.
Hope that explains it a bit.
Peter
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.