java.lang.noclassdeffounderror ...

编程入门 行业动态 更新时间:2024-10-27 12:26:09
本文介绍了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执行命令行命令 [ ^ ] 现在到这个问题: -您使用IDE吗? Eclipse和Netbeans是免费的.请使用其中之一. -如何编译代码? 很棒的文章: 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 ...

本文发布于:2023-05-31 10:02:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/389513.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:java   lang   noclassdeffounderror

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!