Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > javac classpath...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 12 Topic 15899 of 16566
Post > Topic >>

javac classpath; where to compile from?

by Thufir <hawat.thufir@[EMAIL PROTECTED] > Mar 20, 2008 at 10:41 AM

I would like to compile and execute (run) without changing directories.  
Currently, however, I get the following error:

thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 javac -cp src -d /home/thufir/java/build/ src/com/
web_tomorrow/CPTest2.java 
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 java build.com.web_tomorrow.CPTest
Exception in thread "main" java.lang.NoClassDefFoundError: build/com/
web_tomorrow/CPTest
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 



To get good output, only this seems to work:


thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 javac -cp . -d /home/thufir/java/build/ com/
web_tomorrow/CPTest2.java 
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 cd ..
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 cd build/
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 java com.web_tomorrow.CPTest2 
Run CPTest2.main()
thufir@[EMAIL PROTECTED]
 
thufir@[EMAIL PROTECTED]
 



how can I do this without changing directories?


thanks,

Thufir
 




 12 Posts in Topic:
javac classpath; where to compile from?
Thufir <hawat.thufir@[  2008-03-20 10:41:33 
Re: javac classpath; where to compile from?
Roedy Green <see_websi  2008-03-20 12:50:34 
Re: javac classpath; where to compile from?
Mark Space <markspace@  2008-03-20 09:46:40 
Re: javac classpath; where to compile from?
Thufir <hawat.thufir@[  2008-03-20 19:50:07 
Re: javac classpath; where to compile from?
Mark Space <markspace@  2008-03-20 23:36:59 
Re: javac classpath; where to compile from?
Thufir <hawat.thufir@[  2008-03-20 19:50:43 
Re: javac classpath; where to compile from?
Roedy Green <see_websi  2008-03-21 01:04:49 
Re: javac classpath; where to compile from?
Knute Johnson <nospam@  2008-03-20 19:10:08 
Re: javac classpath; where to compile from?
Lew <lew@[EMAIL PROTEC  2008-03-28 22:50:36 
Re: javac classpath; where to compile from?
Mark Space <markspace@  2008-03-28 22:04:59 
Re: javac classpath; where to compile from?
Thufir <hawat.thufir@[  2008-03-21 07:38:08 
Re: javac classpath; where to compile from?
thufir <hawat.thufir@[  2008-03-28 22:25:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 16:03:47 CST 2008.