A
Academic Q
Seems ok installed J2SE 1.5.0 (Windows XP) at home after 1st class of
Java; Java -version shows in shell window; little "hello world"
program written in notepad compiled and ran under shell window and
netbeans. I love Java.
After 2nd class, students required to use command-line code
(Integer.parseInt(args)) to form a program. The code below ran and
could pop up little window to ask user number inputs. With home
machine, the same code was compiled successfully with 0-error, but NO
little pop-up window shown to ask user inputs, ends up nothing happen
when let it run under both shell window and netbeans. fraustrated that
I am stucked in just 2nd class.
Anything wrong with installation or Command-line setting? I
reinstalled J2SE1.5.0, still get the same result.
public static void main(String[] args) {
int[] numbers = new int[args.length];
for (int i = 0; i < args.length ; i++) {
numbers = Integer.parseInt(args);
}
for (int i = 0; i < args.length ; i++) {
System.out.println(numbers);
}
}
Followed the book, I set J2SE Development Kit 5.0 and J2SE Runtime
Environment 5.0 in C:\jdk1.5.0_01 directory (not
C:\program\jdk1.5.0_01) and C:\jre1.5.0_01 directory separately. That
jdk directory contains bin, demo, docs, include, jre, lib, sample, src
folders.
Thank you much!
Ching Shih
Java; Java -version shows in shell window; little "hello world"
program written in notepad compiled and ran under shell window and
netbeans. I love Java.
After 2nd class, students required to use command-line code
(Integer.parseInt(args)) to form a program. The code below ran and
could pop up little window to ask user number inputs. With home
machine, the same code was compiled successfully with 0-error, but NO
little pop-up window shown to ask user inputs, ends up nothing happen
when let it run under both shell window and netbeans. fraustrated that
I am stucked in just 2nd class.
Anything wrong with installation or Command-line setting? I
reinstalled J2SE1.5.0, still get the same result.
public static void main(String[] args) {
int[] numbers = new int[args.length];
for (int i = 0; i < args.length ; i++) {
numbers = Integer.parseInt(args);
}
for (int i = 0; i < args.length ; i++) {
System.out.println(numbers);
}
}
Followed the book, I set J2SE Development Kit 5.0 and J2SE Runtime
Environment 5.0 in C:\jdk1.5.0_01 directory (not
C:\program\jdk1.5.0_01) and C:\jre1.5.0_01 directory separately. That
jdk directory contains bin, demo, docs, include, jre, lib, sample, src
folders.
Thank you much!
Ching Shih