*
The moose likes Java in General and the fly likes problems compiling  for java 1.5/5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problems compiling  for java 1.5/5.0" Watch "problems compiling  for java 1.5/5.0" New topic
Author

problems compiling for java 1.5/5.0

Werner van Mook
Greenhorn

Joined: Feb 21, 2005
Posts: 7
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
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
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

Joined: Feb 21, 2005
Posts: 7
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

Joined: Aug 07, 2003
Posts: 1646
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems compiling for java 1.5/5.0
 
Similar Threads
java problem
About Solaris
Head1stJava - pg 88 - 24 lines of confusion
doing javac -source 1.5 MyClass.java
Trouble with subclassing??