CS211: CodeWarrior Resources
What is CodeWarrior?
- CodeWarrior 8.0 is our officical integrated development environment (IDE).
- Company sites: Metrowerks
and CodeWarriorU.
How do I run a program that is NOT called TrivialApplication
?
- What you really want to do is something called change your target setting,
which tells CodeWarrior from which class to choose a
main
method.
- Click on the Targets tab in a CodeWarrior project.
- Double on the target Java Application Release, which opens a new window.
- Open the Target options in the Java Application Release Settings window.
- Select Java Target.
- In the Java Target panel, enter your desired class name (the name with the
main
method
that you wish to run!) in Main.
How do I use command-line arguments in CodeWarrior?
- Click on the Targets tab in a CodeWarrior project.
- Double on the target Java Application Release, which opens a new window.
- Select Runtime Settings open from the Target Setting Panels, which are inside Target.
- In the Runtime Settings panel, enter your desired strings in Program Arguments.
How do I get scrollback in CodeWarrior output?
- Run the program.
- Click on the upper-left corner of the output window (looks like a
C:\
prompt).
- Select Properties.
- Click the Layout tab.
- Under Screen Buffer Size change Height to 1000.
- Click OK.
- Click Save properties for future windows with same title.
- Click OK.
How do I redirect output to a text file?
- Go to Edit > Java Application Release Settings > Linker > Java Output.
- Set Output type to Application and specify Name.
For example, my_app
for your EXE-file.
- Compile the poject one more time.
- Start the MS-Dos prompt and run the following command from your project directory:
my_app.exe > my_output.txt
.
- All output of your program will be redirected to
my_output.txt
.
How do I use version control in CodeWarrior?
How do I use a class file in CodeWarrior?
- Save the file to your computer, add it to a project, and change the target setting.
How do I access a text file?
- Put this line in at the top of your Main Class:
System.out.println(System.getProperty("user.dir"));
- It will print out the directory that your program is running in. You need to put the input file
in that folder.