Hello to everyone,
I decided to post this thread in this forum and not in Eclipse because I am new to Java and this question is technically not an eclipse one :)
So here is the question:
I compile and run this program in Eclipse and it works perfect.
I am trying to incorporate it in another application by means of a comand line interface ... the application has means of sending a command to a cmd command
interpreter and executing it. When I try and test this on the command line I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: myclass (wrong name: com/example/java/swiss/myclass)
I thought this could be due to my environment not being set-up correctly. So added the following to my CLASSPATH and PATH:
C:\Work\Java Work Space\src\com\example\java\swiss;C:\Work\Java Work Space
C:\Work\Java Work Space\TonerWebService\lib; <==== where the class (in a jar file) my program is calling is located
C:\Work\Java Work Space\TonerWebService\lib\com.example.java.swiss.H ttpConnection.jar; <==== the jar itself
C:\Work\Java Work Space\TonerWebService\classes\com\example\java\swi ss <==== where the compiled class (main) is located
I also tried the following and get the same error.
Java -cp "C:\Work\Java Work Space\TonerWebService\lib;C:\Work\Java Work Space\TonerWebService\lib\com.example.java.swiss.H ttpConnection.jar" myclass
I also included -jar "<PATH TO JAR>" but without success.
Do you have any idea as to where I am going wrong? Is there anything I am missing???
Is there any where in Eclipse you can capture the java command line that the IDE executes to run myclass .. perhaps some log file or a way that this command line can be generated within the IDE??