• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need instruction on compiler flags  RSS feed

 
Eric Larsen
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I've just begun learning java, and I need some help regarding the javac flags

1. How do I set -d permanently so I don't have to type it in every time I compile something?

2. What is -classpath and -sourcepath?

3. Is there a way to set my PATH environment variable so that my system looks in a specific directory for source files when I use javac?

Thank you in advance. I know that you'll be able to help because this is probably a ridiculously simple concept that I'm just not getting.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Eric ,

Welocme to Javaranch.

Let me pick the first one..

1. How do I set -d permanently so I don't have to type it in every time I compile something?

- Write a batch file (in windows) or shell script( Unix) to do the job for you.

 
Eric Larsen
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balu Sadhasivam wrote:

Eric ,

Welocme to Javaranch.

Let me pick the first one..

1. How do I set -d permanently so I don't have to type it in every time I compile something?

- Write a batch file (in windows) or shell script( Unix) to do the job for you.



Thanks for the help, although I don't know much about batch, (I can set variables and echo them to the screen, but that's about it) so how might I go about doing that? You can also give me a link to a tutorial or something if you don't feel like explaining it.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have used shell scripts to compile java files , so should be possible using BATCH file.. anyways if you want to compile dozens of files and organise and package it , ANT tool , especially javac task can help you.

Here are the links

Ant tutorial
javaranch old Ant tutorial
javac task

cheers.
 
Eric Larsen
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Balu!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!