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

Exporting jar using the absences API

 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

0 votes



One answer

Permanent link
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).

0 votes

Comments

 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

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 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,954

Question asked: Jul 12 '16, 8:32 a.m.

Question was seen: 2,196 times

Last updated: Jul 13 '16, 5:49 a.m.

Confirmation Cancel Confirm