-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.JavaTools
77 lines (48 loc) · 2.39 KB
/
README.JavaTools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Java Tools
----------
Java versions of the LeJOS tools are now available.
These are:
firmdl : downloads the lejos firmware
lejosjc : compiles lejos java source files
lejoslink : links lejos programs and produces a binary file for download
lejosdl : downloads lejos programs
These are equivalents of lejosfirmdl, lejosc, lejos and lejosrun.
These commands are issued as Unix/Linux shell scripts and Windows batch files.
For example, there is a a shell script called firmdl, and a Windows batch
file called firmdl.bat in the lejos bin directory. They should run correctly
under Unix, Linux, MAC OSX, Windows and cygwin, with the correct version being
chosen automatically.
The Java versions have almost exactly the same flags as the existing versions
of the tools, but with the omission of some rarer options. firmdl does not
support fast download - lejosfirmdl supports this with serial towers only.
These commands require the environment variable LEJOS_HOME to be set. For example,
on Windows you might do:
set LEJOS_HOME=c:\lejos
on Linux the equivalent command would be something like:
export LEJOS_HOME=/home/username/lejos
The port that the IR Tower is connected to is specified in the normal way -
either by RCX_PORT=COM1 or RCX_PORT=usb etc, or by a --tty option on the command.
The normal usage of the commands is:
To download the firmware:
firmdl
To compile a java class:
lejosjc MyClass.java
To link the program and produce a binary file:
lejoslink MyClass -o MyClass.bin
To download the binary file:
lejosdl MyClass.bin
The other commonly used options are compiling multiple source files with lejosjc,
linking multiple class files with lejoslink and producing verbose output from
lejoslink by:
lejoslink -verbose MyClass1 MyClass2 ... -o MyClass.bin > MyClass.sig
The verbose output lets you see which classes and methods are included and excluded
in your linked binary.
Use the -h or --help flag to get help on options, e.g:
firmdl -h
The advantages of the Java Tools over the current C tools are:
- They are more easily understood by Java programmers
- They are easier to port to some platforms
- The shell and batch files are easier to understand and modify to your needs
- It may be easier to use them in Java IDEs
- You can incorporate the download code in your own Java programs
A future version of firmdl will implement fast download for serial and usb IR towers.