It's all about the answers!

Ask a question

Exporting jar using the absences API


nhelldorff (156) | asked Jul 12 '16, 8:32 a.m.
 Hello,
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(https://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/). 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 (93749) | answered Jul 12 '16, 3:56 p.m.
JAZZ DEVELOPER
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).

Comments
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. 


Exception:
IllegalArgumentException: The type name Contributor and the namespace URI com.ibm.team.repository do not resolve to an IItemType


Ralph Schoon commented Jul 13 '16, 5:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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%
pause

Your answer


Register or 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.