Results 1 to 9 of 9
Thread: Command Prompt Java
- 11-26-2009, 09:21 AM #1
Member
- Join Date
- Jul 2009
- Posts
- 4
- Rep Power
- 0
Command Prompt Java
Hi I have project in eclipse with packages
com.mypackage.abc.java
com.mypackage.def.java
I can run both programs in eclipse fine, but i want to run it from command prompt.
The root of my source file is c:\project\src
Classes for these are at c:\project\target
so I change directory to
c:\project\target
java -classpath . com.mypacakage.abc
but it returns NoClassDefFoundError
can someone please help.
- 11-26-2009, 09:39 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 11-26-2009, 09:45 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 4
- Rep Power
- 0
Hi Jos, thanks for your reply. Yes I can find those classes in there.
- 11-26-2009, 09:54 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 11-26-2009, 10:02 AM #5
Member
- Join Date
- Jul 2009
- Posts
- 4
- Rep Power
- 0
sorry about my typo, i've read it onthe web that this is how i am suppose to do it like what you are saying, but for some strange reason, it doesn't work for me, really weird.
if i package it into a jar file then it works
- 11-26-2009, 10:40 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 11-26-2009, 02:02 PM #7
Member
- Join Date
- Jul 2009
- Posts
- 4
- Rep Power
- 0
yes I did. I changed directory to the directory where the com directory is located (ie c:\project\target" before I run the command.
- 11-26-2009, 05:17 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 11-27-2009, 10:30 AM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
[SOLVED] Running java programs from the command prompt
By wiz0r in forum New To JavaReplies: 6Last Post: 04-20-2009, 04:34 AM -
how to run windows command prompt in java parogram ?
By indikasampath2000 in forum AWT / SwingReplies: 4Last Post: 12-16-2008, 06:51 AM -
Is there any way to run java file through command prompt of .jar
By sachin.parnami in forum New To JavaReplies: 2Last Post: 12-03-2008, 01:24 PM -
Running eclipse java project on command prompt
By hnmapara in forum New To JavaReplies: 1Last Post: 07-09-2008, 08:29 AM -
accessing command prompt using java (netbeans)...
By kureikougaiji in forum New To JavaReplies: 6Last Post: 06-27-2008, 03:01 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks