Java - compiling?!

  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

hi, i am doing this hello world java tutorial...

i typed out the code in dos, saved as a .java file.... then im asked to compile it by adding:

C:/DIRECTORY>javac First.java

where do i compile it?!!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

It will compile it to the directory it is located in

someone showed me a really cool trick for the command prompt

type the name of the executable then a sapce then /?
ie javac /?

it will show all the possible switches and parameters for the javac file
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

so: myfirstjavaprog.java ?/
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

no just type in javac /?

if your environmental variables are set correctly then it will recognise it otherwise you may have to go to the directory where you installed your java sdk and then into the bin directory to execute the javac file.

the call to javac is telling the java compiler to build or compile your java file so the run time environment can understand it
  • TheGuy531
  • Born
  • Born
  • TheGuy531
  • Posts: 2

Post 3+ Months Ago

ewww, programming in Dos? why?
Get jcreator, its an amazing java compiler, and free too.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

No not programming in DOS. Compiling in DOS.

Or you could get an IDE like mentioned above but I like to take the hard route when learning a new language because you tend to learn more and are not reliant on any IDE's. So should you ever have to do any debugging on a machine that doesn't have the IDE you can find a way round it - after all every windows machine has a command prompt!

Thanks for that info though - I will go check it out
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

agreed with rabid, thats what i been doing with php and not with java.

Thanks to rabid i got this far, cheers for your help bud.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Only a pleasure :wink:
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

:D

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 109 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.