[CMake] Java Support

Alex Brandt alunduil at alunduil.com
Fri Jan 22 20:47:29 EST 2010


On Friday 22 January 2010 2:26:58 pm you wrote:
> What specific problems are you having with your Java code?
> ___________________________________________________________
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net
> BlueQuartz Software               Dayton, Ohio

I'm getting the following error when trying to run the Java application I 
compile:

alunduil at elijah ~/work/adsoap/build/test $ java LdapTest
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/novell/ldap/LDAPReferralException
Caused by: java.lang.ClassNotFoundException: 
com.novell.ldap.LDAPReferralException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
Could not find the main class: LdapTest. Program will exit.

The CMake file I'm using is the following:

project(AdSoapService Java)
cmake_minimum_required(VERSION 2.6)

set(CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS} -
Xlint:deprecation")

include_directories(/usr/share/soap/lib/soap.jar)
include_directories(/usr/share/jldap/lib/ldap.jar)

set(Zimbra_SRC
    Zimbra/ZimbraAccount.java)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Zimbra.dir/Zimbra/)
message(STATUS "${CMAKE_CURRENT_BINARY_DIR}")
add_library(Zimbra ${Zimbra_SRC})

set(AdSoapService_SRC
    AdSoapService/AdSoapSession.java
    AdSoapService/AdSoapService.java
    AdSoapService/AdSoapServiceImpl.java)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/AdSoapService.dir/AdSoapService/)
add_library(AdSoapService ${AdSoapService_SRC})

add_dependencies(AdSoapService Zimbra)

add_subdirectory(test)

Regards,

Alex Brandt

-- 
B.S. Physics & Computer Science
Minnesota State University Moorhead
www.alunduil.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100122/af69ed2e/attachment.pgp>


More information about the CMake mailing list