It's all about the answers!

Ask a question

Using wcl in linux


André Teste (115) | asked Oct 03 '19, 5:17 a.m.
edited Oct 04 '19, 11:49 a.m. by Ralph Schoon (63.1k33645)

 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 ?


2 answers



permanent link
Kevin Ramer (4.5k8183200) | answered Oct 03 '19, 1:55 p.m.
edited Oct 03 '19, 3:53 p.m.

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 "$@"


Comments
André Teste commented Oct 04 '19, 5:12 a.m.

 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
Ralph Schoon (63.1k33645) | answered Oct 04 '19, 6:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Comments
André Teste commented Oct 04 '19, 7:30 a.m.

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


Ralph Schoon commented Oct 04 '19, 7:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Ralph Schoon commented Oct 04 '19, 12:18 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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 to post your answer.