The Artima Developer Community
Sponsored Link

Java Answers Forum
package statement

1 reply on 1 page. Most recent reply: Jul 6, 2009 10:33 PM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
joseph morrell

Posts: 1
Nickname: dingoweed
Registered: Jul, 2009

package statement Posted: Jul 3, 2009 4:30 PM
Reply to this message Reply
Advertisement
using the command line i have no problem compiling and executing simple java classes. at first i had a problem with using the package statement but read online somewhere that if i compiled a source file inside a directory with the same name as the package statement name it would compile. i tried this and it works fine, the compiled class file materializing in the same directory as the source file. so far ok. however, when i try to execute the class file from the command line i get the no class def found error message. any classes i have created without package statements are easy to execute. only the presence of the package statement in the source file from which the class file is compiled causes the abort with error message.


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: package statement Posted: Jul 6, 2009 10:33 PM
Reply to this message Reply
Just a suggestion - this is what I do for thick clients.

Package your software in a Jar, make sure your manifest file states what your Main-class is.

Then you can execute it by:

java -jar MyProgram.jar

You may want to learn basics of build tools such as Ant and Maven. Ant is easier to learn IMO - so if you're starting out use that to compile and package your Software.

Flat View: This topic has 1 reply on 1 page
Topic: Multiple persistence Unit Previous Topic   Next Topic Topic: Needed urgent help in jsp

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use