• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

problems compiling for java 1.5/5.0

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I do have a very basic java question.

I have the following class :

public class IntTest
{

public static void main(String[] args)
{
Integer i = 100;
Integer i2 = 100;
System.out.println((i == i2)? "Yes equal": "Nope not equal");

}
}

I want to compile this class on a win2000 system with jdk 1.5 installed.
java -version gives me :
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

If I'm correct : I want to compile this. because I use autoboxing I have to compile this using the -source 1.5 flag.

If I do : javac -source 1.5 IntTest.java
I get :
javac: invalid flag: -source
Usage: javac <options> <source files>
where possible options include:......... etc.
In the list with possible options it does not state : source

What am I doing wrong?

Kind regards
Werner
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Werner van Mook:
java -version gives me :
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

What does the following give you?
 
Werner van Mook
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It tells me that you can't do javac - version.

javac: invalid flag: -version
Usage: javac <options> <source files>
where possible options include:.......
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Funny, I get this:I would have expected the -version flag to have existed in 1.0, but maybe it's not and you have an ancient JDK on your system. Does your path include multiple JDKs?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic