It's all about the answers!

Ask a question

Exporting jar using the absences API

nhelldorff (154) | asked Jul 12 '16, 8:32 a.m.
I would like to export(to jar) my little program which I have written using the RTC plain Java APIs and some interfaces from rsjazz to manage absences( Everytime I export it and try to run it, it doesn't work, so my question is, what do I have to do, what is the problem. It always throws a class not found expection when i try to run the exported jar from the console. But when I run it in Rational Team Concert everything works fine. 

Thanks in advantage.

Nicolai Helldorff

One answer

permanent link
Alan Sampson (93729) | answered Jul 12 '16, 3:56 p.m.
The likelihood is that the jar you exported only contains the classes you created in your application and you aren't providing the RTC API (and potentially; Eclipse etc.) classes when you run the jar outside of the RTC Eclipse client.  In order to run a Java application it must have access to all the classes it needs at run-time so you'll need to add the jars you use to build the application to the Java class path (via the -cp switch).

nhelldorff commented Jul 13 '16, 3:44 a.m.

 When I try to export it as runnable jar file, it copies all needed libaries. The program is about 50 Megabyte big. 

IllegalArgumentException: The type name Contributor and the namespace URI do not resolve to an IItemType

Ralph Schoon commented Jul 13 '16, 5:49 a.m.

I never succeeded to create a runnable. I always use the other option and then I run it like this:

set JAVA_HOME=..\TeamConcert\jazz\client\eclipse\jdk
set REPOSITORY="https://localhost:9443/ccm"
set USERID="myadmin"
set PASSWORD="myadmin"
set PLAIN_JAVA=../PlainJavaAPI

%JAVA_HOME%\jre\bin\java -Djava.ext.dirs=%PLAIN_JAVA%;%JAVA_HOME%/jre/lib/ext -cp %PLAIN_JAVA% -jar WorkshopSetup.jar %REPOSITORY% %USERID% %PASSWORD%

Your answer

Register or to post your answer.