Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using wcl in linux

 Hey, i am trying to use in a linux distro. I tried multiple java builds from java 8. I setup the script like this:

#!/bin/sh
#JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin
export PLAIN_JAVA=/usr/PlainJava

#export JAVA_HOME
#export PLAIN_JAVA

/WCL/jdk1.8.0_141/bin/java -Djava.security.policy=rmi_no.policy -Djava.ext.dirs=./lib:$PLAIN_JAVA:$JAVA_HOME/jre/lib/ext -cp ./lib:$PLAIN_JAVA% -jar wcl.jar "$@"

And i keep getting this error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/team/repository/common/TeamRepositoryException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.ibm.team.repository.common.TeamRepositoryException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

Can someone help me in this matter ?


0 votes



2 answers

Permanent link

There is a 'mix' of unix / windows variable referencing it seems: 

-Djava.ext.dirs=./lib:$PLAIN_JAVA:$JAVA_HOME/jre/lib/ext -cp ./lib:$PLAIN_JAVA% -jar wcl.jar "$@"

Try knocking off the % after PLAIN_JAVA.  

$JAVA_HOME/bin/java -Djava.security.policy=rmi_no.policy -Djava.ext.dirs=./lib:$PLAIN_JAVA:$JAVA_HOME/jre/lib/ext -cp ./lib:$PLAIN_JAVA -jar wcl.jar "$@"

0 votes

Comments

 I tried that but the result is not positive. Error is the same. I just change the path in that script, i guess the default script was adapted to unix.


Permanent link

I recently found out the order of the ext dirs is important and, as Kevin rightly points out, at some time some Windows CMD syntax crept in that needed to be fixed.

It would still not work for me on a red hat Linux but it seemed to work for another user. I did not have the time to look into it deeper.

0 votes

Comments

 Can you show me the link where the user claims that the script work ?

Sorry, can't find it. I basically copied the answer into my script. It was about 25 days ago.

This was basically how it looked like:
#!/bin/sh
#JAVA_HOME=/usr/java/jdk1.8.0_20/bin
#export JAVA_HOME

PLAIN_JAVA=/usr/RTC606Dev/Installs/PlainJavaAPI
export PLAIN_JAVA

# In the -Djava.ext.dirs always keep the Java distribution in the front
$JAVA_HOME/bin/java -Djava.security.policy=rmi_no.policy -Djava.ext.dirs=$JAVA_HOME/lib/ext:$JAVA_HOME/jre/lib/ext:./lib:$PLAIN_JAVA -cp ./lib:$PLAIN_JAVA% -jar wcl.jar "$@"

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10

Question asked: Oct 03 '19, 5:17 a.m.

Question was seen: 2,273 times

Last updated: Oct 04 '19, 12:18 p.m.

Confirmation Cancel Confirm