简体   繁体   中英

How to run Netflix Astyanax in linux

I'm a newbie in running Java code in Linux environment. I'm trying to get the Astyanax to work on the linux machine. I followed the instruction on https://github.com/Netflix/astyanax/wiki/Getting-Started I have cloned the code from github, and ./gradlew build runs successfully.

I'm trying to run the AstClient in the astyanax-examples. I tried the following command:

java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/ ;/home/shbash6/astyanax/astyanax-cassandra/build/libs/ ;/home/shbash6/astyanax/astyanax-core/build/libs/ ;/home/shbash6/astyanax/astyanax-thrift/build/libs/ " com.netflix.astyanax.examples.AstClient

under holder: /home/shbash6/astyanax/astyanax-examples/build/classes/main

but I got the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/netflix/astyanax/examples/AstClient Caused by: java.lang.ClassNotFoundException: com.netflix.astyanax.examples.AstClient at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: com.netflix.astyanax.examples.AstClient. Program will exit.

Could anyone tell me how to fix this issue? Thanks!

使用: * nix平台上的类路径分隔符

java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/*:/home/shbash6/astyanax/astyanax-cassandra/build/libs/*:/home/shbash6/astyanax/astyanax-core/build/libs/*:/home/shbash6/astyanax/astyanax-thrift/build/libs/*" com.netflix.astyanax.examples.AstClient

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM