Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need a right place to learn execution of Java through command line

 
s sivaraman
Ranch Hand
Posts: 59
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

could anyone spot me a place where i can learn everything about compiling and excecuting a java program(with package ,without package, ...etc) through command prompt?

thank you
 
nick woodward
Ranch Hand
Posts: 370
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
s sivaraman wrote:Hi,

could anyone spot me a place where i can learn everything about compiling and excecuting a java program(with package ,without package, ...etc) through command prompt?

thank you


*shudder* i'm having a look now, because I spent days on this, but i can't seem to find the website I liked.

I would just google and experiment. You'll run into problems with classpaths and running the compiler from the wrong root directory, then you can google that too. I would do this over using the oracle tutorials on the subject. I personally think they are poor.

Let me go and have a quick look for you, but regardless, if you work on it yourself it would help me too if you post your problems here. I've *mastered* it twice now, but because I'm not doing it daily it often catches me out, so I could do with the practise.

nick

*edit: here you go, I liked this explanation: http://kevinboone.net/classpath.html (although it's more about the classpath than the basics, which relates to packages)

 
s sivaraman
Ranch Hand
Posts: 59
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I would just google and experiment. You'll run into problems with classpaths and running the compiler from the wrong root directory, then you can google that too.


sounds exactly like me.

Let me go and have a quick look for you,

i'm counting on it....

but regardless, if you work on it yourself it would help me too if you post your problems here.

i do.


I liked this explanation: http://kevinboone.net/classpath.html (although it's more about the classpath than the basics, which relates to packages)

i'm on it...
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
s sivaraman wrote:could anyone spot me a place where i can learn everything about compiling and excecuting a java program(with package ,without package, ...etc) through command prompt?

When it comes down to compiling source code files and running class files from the command line, you'll definitely need a good understanding of packages. So have a look at the lesson about packages of Oracle's Java tutorials, especially the Managing Source and Class Files section.

In the The "Hello World!" Application lesson provides detailed instructions for compiling and running a simple "Hello World!" application. And this article has a good explanation about the basics of compiling and running using a more complex example.

These pages could be useful as well some time: javac and java. Don't be intimidated by the gazillion options you can use for both commands. You'll probably only need to know the option -cp (or -classpath).

Finally, most study guides for the OCA exam will have basic coverage about javac and java as well, because it's recommended to prepare for the OCA exam not using an IDE but only your favourite text editor, javac and java. (And it's an exam objective for the OCA8 exam as well)

If you are experiencing any problem/issue when compiling or running an application, just create a new topic in this forum and ask your question. CodeRanch is really packed with friendly ranchers who will definitely help you to solve your problems.

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic