java.lang.noclassdeffounderror ... [英] java.lang.noclassdeffounderror...

查看:130
本文介绍了java.lang.noclassdeffounderror ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想从Java代码中运行以下命令行命令


F:Dev \ Data \ ServerDir \ schema> admin -action runActivity -script 28.0.1234554321 -select"A111111,password3"-用户E0987808 -password apple -key XYZ12847NK.

为此,我编写了此代码

Hi All,


I want to run following command line command from a java code


F:Dev\Data\ServerDir\schema>admin -action runActivity -script 28.0.1234554321 -select "A111111,password3" -user E0987808 -password apple -key XYZ12847NK.

For this i have written this code

import java.io.*;
import java.lang.*;
public class ProcessBuildDemo {
 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String b =("admin").concat(" ").concat("-").concat("action").concat(" ").concat("runActivity").concat(" ").concat("-").concat("script").concat(" ").concat("28.0.1234554321").concat(" ").concat("-").concat("selected").concat(" ").concat("\"").concat("A111111").concat(",").concat("password3").concat("\"").concat(" ").concat("-").concat("user").concat(" ").concat("E0987808").concat(" ").concat("-").concat("password").concat(" ").concat("apple").concat(" ").concat("-").concat("key").concat(" ").concat("XYZ12847NK");
		//String a = "WindowsApplication1.exe";
		//String [] command= {"CMD","/c",a};
		String [] command = {"CMD","/c",b};
		ProcessBuilder pb= new ProcessBuilder(command);
		pb.directory(new File("F:\\Dev\\ServerDir\\schema"));
		try {
			pb.start();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
 
	}
 
}



每当我运行此代码时,我都会在线程"main" java.lang.NoClassDefFoundError:ProcessBuildDemo/class
中遇到提及异常的异常. 我是Java新手,请帮助我解决此问题.



Whenever I am running this code i am getting an Exception mentioning Exception in thread "main" java.lang.NoClassDefFoundError: ProcessBuildDemo/class
I am new in java please help me resolving this issue.

推荐答案

首先-在此处检查问题的答案:
从Java执行命令行命令 [ 3种解决Java中NoClassDefFoundError的方法 [
First of all - check the answer to your question here:
Executing Command line command from java[^]

And now to this Question:
- do you use a IDE? Eclipse and Netbeans are free. Please use one of them.
- how do you compile your code?



great article:
3 ways to resolve NoClassDefFoundError in Java[^]


这篇关于java.lang.noclassdeffounderror ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆