command line - Running Java program from Python -


I have noticed, and,

They were not sufficiently adequate when they were informative. To know the root cause of my problem, my code is not within a jar file and the customer has requested that we should not ship it.

I made an application in Alps and it is running fine from there. I have established a script which will modify the main method of one of the Java files for testing purposes. I want to run the application using a call from Python after modifying it. However, when I use java or java -cp If I try to call the program using , I get the following error from the command line:

  Exception in the formula "main" java.lang.NoClassDefFoundError: java.lang .ClassNotFoundException: java.security.AccessController.doPrivileged in Java due to DemoAPIFunctionality (Native method) at java.net.URLClassLoader DemoAPIFunctionality .net.URLClassLoader.findClass (unknown source $ 1.run (unknown source)) Java Java sun.misc.Launcher java.lang.ClassLoader.loadClass (unknown source $ AppClassLoader.loadClass on KlangkClassLoaderkloadClass) Kla on (unknown source) (unknown source) Ng.ClassLoader.loadClassInternal (unknown source) Main category could not be found: DemoFunction. The program will exit  

My project depends on many Jars, which is not in the root directory, and a DLL file, then not in the root directory. I hope this is related to the place of one of them, but I am not sure and I am moving a little further. Here DemoAPIFunctionality.java :

  public class DemoAPIFunctionality {public final static void I (String [] args) {DemoAPIFunctionality demo = new DemoAPIFunctionality ();  

If you help me assist you, I will be happy to have some other information list (No, I am not a sports agent.) What do I need to do?

Thanks in advance.

You have not mentioned that your dragon script actually executes editing after the Java source file Compile it.

Eclipse will compile it automatically (build-in builder) but of course, you must call javac before executing a class outside the IDE. java will not work on source files.

Edit

I do not know the real experience in Java - but this is how it usually works on the command line.

Assume that you have a Java class com.example.Hello as a main method and

as a file structure
 code  Dev / bin / com / example / Hello.class  

then you type cd for / dev / bin and a Java com.example.Hello . Note that the name of the package ( com.example ) is always mapped to the folder structure ( com / example ). > If you do the above command and you do not get Java Hello.class folder ./ com / example , then it will throw NoClassDefFoundError


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -