Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How do I change compilers so I can use javac?
How do I change compilers so I can use javac? [message #242541] Fri, 06 April 2007 15:59 Go to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

I want to try compiling my applet with javac instead of the JDT compiler.

I have run into a problem with MemoryImageSouce -- it flickers when
setting newPixels() -- and it shouldn't.

It's probably something I've done wrong but I can't think of anything
else to try right now and I want to see if compiling with javac
will have any effect on the problem.

So where is the place I switch to javac????
Re: How do I change compilers so I can use javac? [message #242546 is a reply to message #242541] Fri, 06 April 2007 16:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"DemonDuck" <kwarner@uneedspeed.net> wrote in message
news:ev68km$r8k$1@build.eclipse.org...
>I want to try compiling my applet with javac instead of the JDT compiler.
>
> I have run into a problem with MemoryImageSouce -- it flickers when
> setting newPixels() -- and it shouldn't.
>
> It's probably something I've done wrong but I can't think of anything
> else to try right now and I want to see if compiling with javac
> will have any effect on the problem.
>
> So where is the place I switch to javac????

If you generate an ant script, and build by running the ant script, you will
be using javac.

When you're using the IDE build, however, there is no way to set it to use
javac.

Personally I would be awfully surprised if there were any difference.
Re: How do I change compilers so I can use javac? [message #242551 is a reply to message #242546] Sat, 07 April 2007 20:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Walter,

Would you or anybody else have a simple ANT script that compiles
a java source file? I've never used ANT and an example script
would be a great help. I can extrapolate from and example script
to figure out what to do....

The problem I'm facing is this --

I've used MemoryImageSource in Java 1.4 and it worked great.
In 1.5 using the JDT compiler -- it sucks! The image flickers
and tears badly. I've tried everything I can think of to
double buffer and use BufferStrategy and I can't get rid of
the flicker and tearing. Last resort is to compile under
a different compiler to see if there is any difference.

I expect there will be no difference but I must do this
for completness.

Walter Harley wrote:
> "DemonDuck" <kwarner@uneedspeed.net> wrote in message
> news:ev68km$r8k$1@build.eclipse.org...
>
>>I want to try compiling my applet with javac instead of the JDT compiler.
>>
>>I have run into a problem with MemoryImageSouce -- it flickers when
>>setting newPixels() -- and it shouldn't.
>>
>>It's probably something I've done wrong but I can't think of anything
>>else to try right now and I want to see if compiling with javac
>>will have any effect on the problem.
>>
>>So where is the place I switch to javac????
>
>
> If you generate an ant script, and build by running the ant script, you will
> be using javac.
>
> When you're using the IDE build, however, there is no way to set it to use
> javac.
>
> Personally I would be awfully surprised if there were any difference.
>
>
Re: How do I change compilers so I can use javac? [message #242556 is a reply to message #242551] Sat, 07 April 2007 21:34 Go to previous messageGo to next message
Eclipse UserFriend
I am with Walter.

What I would suggest is compiling against the 1.4 class libraries so you use
the 1.4 version of MemoryImageSource.
The class libraries (which I am assuming MemoryImageSource is from) are not
compiled with the Eclipse compiler so changing what compiler you are using
to compile your source which is using these classfile should have no impact.
Set the JRE for your project to a 1.4 install and you should be fine.

That said:
For example Ant buildfiles take a look at the org.eclipse.ant.ui plugin
available in the Eclipse repository....instructions found here:
http://dev.eclipse.org/viewcvs/index.cgi/platform-ant-home/c ontributing.html?view=co

also:
http://ant.apache.org/manual/CoreTasks/javac.html

HTH
Darins

"DemonDuck" <kwarner@uneedspeed.net> wrote in message
news:ev9bq8$fii$1@build.eclipse.org...
> Walter,
>
> Would you or anybody else have a simple ANT script that compiles
> a java source file? I've never used ANT and an example script
> would be a great help. I can extrapolate from and example script
> to figure out what to do....
>
> The problem I'm facing is this --
>
> I've used MemoryImageSource in Java 1.4 and it worked great.
> In 1.5 using the JDT compiler -- it sucks! The image flickers
> and tears badly. I've tried everything I can think of to double buffer
> and use BufferStrategy and I can't get rid of
> the flicker and tearing. Last resort is to compile under a different
> compiler to see if there is any difference.
>
> I expect there will be no difference but I must do this
> for completness.
>
> Walter Harley wrote:
>> "DemonDuck" <kwarner@uneedspeed.net> wrote in message
>> news:ev68km$r8k$1@build.eclipse.org...
>>
>>>I want to try compiling my applet with javac instead of the JDT compiler.
>>>
>>>I have run into a problem with MemoryImageSouce -- it flickers when
>>>setting newPixels() -- and it shouldn't.
>>>
>>>It's probably something I've done wrong but I can't think of anything
>>>else to try right now and I want to see if compiling with javac
>>>will have any effect on the problem.
>>>
>>>So where is the place I switch to javac????
>>
>>
>> If you generate an ant script, and build by running the ant script, you
>> will be using javac.
>>
>> When you're using the IDE build, however, there is no way to set it to
>> use javac.
>>
>> Personally I would be awfully surprised if there were any difference.
Re: How do I change compilers so I can use javac? [message #242560 is a reply to message #242556] Sat, 07 April 2007 23:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Darin,

Thanks. I wrote a .bat script by hand. Found out that there is
no difference in behavior as you suggested. Will look and learn ANT
so next time.....

Will try compiling against the 1.4 classes. It must be something
I'm doing wrong although I've done this a hundred times with success.

Such is programming....

BTW: Will Eclipse 3.2.1 support Java 1.6????

Darin Swanson wrote:
> I am with Walter.
>
> What I would suggest is compiling against the 1.4 class libraries so you use
> the 1.4 version of MemoryImageSource.
> The class libraries (which I am assuming MemoryImageSource is from) are not
> compiled with the Eclipse compiler so changing what compiler you are using
> to compile your source which is using these classfile should have no impact.
> Set the JRE for your project to a 1.4 install and you should be fine.
>
> That said:
> For example Ant buildfiles take a look at the org.eclipse.ant.ui plugin
> available in the Eclipse repository....instructions found here:
> http://dev.eclipse.org/viewcvs/index.cgi/platform-ant-home/c ontributing.html?view=co
>
> also:
> http://ant.apache.org/manual/CoreTasks/javac.html
>
> HTH
> Darins
>
> "DemonDuck" <kwarner@uneedspeed.net> wrote in message
> news:ev9bq8$fii$1@build.eclipse.org...
>
>>Walter,
>>
>>Would you or anybody else have a simple ANT script that compiles
>>a java source file? I've never used ANT and an example script
>>would be a great help. I can extrapolate from and example script
>>to figure out what to do....
>>
>>The problem I'm facing is this --
>>
>>I've used MemoryImageSource in Java 1.4 and it worked great.
>>In 1.5 using the JDT compiler -- it sucks! The image flickers
>>and tears badly. I've tried everything I can think of to double buffer
>>and use BufferStrategy and I can't get rid of
>>the flicker and tearing. Last resort is to compile under a different
>>compiler to see if there is any difference.
>>
>>I expect there will be no difference but I must do this
>>for completness.
>>
>>Walter Harley wrote:
>>
>>>"DemonDuck" <kwarner@uneedspeed.net> wrote in message
>>>news:ev68km$r8k$1@build.eclipse.org...
>>>
>>>
>>>>I want to try compiling my applet with javac instead of the JDT compiler.
>>>>
>>>>I have run into a problem with MemoryImageSouce -- it flickers when
>>>>setting newPixels() -- and it shouldn't.
>>>>
>>>>It's probably something I've done wrong but I can't think of anything
>>>>else to try right now and I want to see if compiling with javac
>>>>will have any effect on the problem.
>>>>
>>>>So where is the place I switch to javac????
>>>
>>>
>>>If you generate an ant script, and build by running the ant script, you
>>>will be using javac.
>>>
>>>When you're using the IDE build, however, there is no way to set it to
>>>use javac.
>>>
>>>Personally I would be awfully surprised if there were any difference.
>
>
>
Re: How do I change compilers so I can use javac? [message #242565 is a reply to message #242560] Sun, 08 April 2007 01:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"DemonDuck" <kwarner@uneedspeed.net> wrote in message
news:ev9ou8$447$1@build.eclipse.org...
> Darin,
>
> Thanks. I wrote a .bat script by hand. Found out that there is
> no difference in behavior as you suggested. Will look and learn ANT
> so next time.....
>
> Will try compiling against the 1.4 classes. It must be something
> I'm doing wrong although I've done this a hundred times with success.
>
> Such is programming....
>
> BTW: Will Eclipse 3.2.1 support Java 1.6????


Eclipse 3.2.2 is the latest released version; Eclipse 3.3 is in development.
Eclipse 3.2.2 runs on a Java 1.6 VM just fine, and the java compiler in
Eclipse 3.2.2 supports most of Java 6's language features, with a few
exceptions that you most likely don't care about. Eclipse 3.3 will fully
support all of Java 6's features. But since Java 6 contains only slight
changes from Java 5, I strongly suspect these distinctions are not relevant
to anything you're doing.

You can generate an Ant script (which will be a .xml, not a .bat) in Eclipse
with File -> Export -> General -> Ant Buildfiles. Inspecting the resulting
file will give you a bit of an introduction to Ant; to get more, you could
take a look at the online documentation for Ant, or you could purchase the
O'Reilly book. Ant resembles other make systems in that an Ant script
describes a set of dependencies and actions: "file B depends on file A, and
if it is out of date, perform action X."

Eclipse does not use Ant internally, but essentially everything that Eclipse
does during a build can be represented in terms of actions driven by Ant
dependencies. In particular, java compilation within Eclipse does not use
the javac compiler, but the Eclipse java compiler does an exceptionally good
job of behaving very very much like the javac compiler does (and when it
doesn't, we try hard to fix whichever one is wrong). As Darin says,
regardless of compiler, the same libraries are used; for most UI code,
therefore, the compiler makes no difference whatsoever, in the same sense
that a Porsche in a traffic jam goes no faster than a Geo Metro.
Re: How do I change compilers so I can use javac? [message #242570 is a reply to message #242565] Sun, 08 April 2007 02:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Very helpful information. I've written a lot of
Makefiles in the old UNIX days. ANT probably won't
be all that hard to figure out. A dependency by
any other name (or syntax) etc....

I'm totally boggled by what I'm seeing with
MemoryImageSource. I find no reported bugs in
SUN's bugbase that is similar. I know it will be a
forehead slapper when I find it.

Thanks for the help.

Walter Harley wrote:
> "DemonDuck" <kwarner@uneedspeed.net> wrote in message
> news:ev9ou8$447$1@build.eclipse.org...
>
>>Darin,
>>
>>Thanks. I wrote a .bat script by hand. Found out that there is
>>no difference in behavior as you suggested. Will look and learn ANT
>>so next time.....
>>
>>Will try compiling against the 1.4 classes. It must be something
>>I'm doing wrong although I've done this a hundred times with success.
>>
>>Such is programming....
>>
>>BTW: Will Eclipse 3.2.1 support Java 1.6????
>
>
>
> Eclipse 3.2.2 is the latest released version; Eclipse 3.3 is in development.
> Eclipse 3.2.2 runs on a Java 1.6 VM just fine, and the java compiler in
> Eclipse 3.2.2 supports most of Java 6's language features, with a few
> exceptions that you most likely don't care about. Eclipse 3.3 will fully
> support all of Java 6's features. But since Java 6 contains only slight
> changes from Java 5, I strongly suspect these distinctions are not relevant
> to anything you're doing.
>
> You can generate an Ant script (which will be a .xml, not a .bat) in Eclipse
> with File -> Export -> General -> Ant Buildfiles. Inspecting the resulting
> file will give you a bit of an introduction to Ant; to get more, you could
> take a look at the online documentation for Ant, or you could purchase the
> O'Reilly book. Ant resembles other make systems in that an Ant script
> describes a set of dependencies and actions: "file B depends on file A, and
> if it is out of date, perform action X."
>
> Eclipse does not use Ant internally, but essentially everything that Eclipse
> does during a build can be represented in terms of actions driven by Ant
> dependencies. In particular, java compilation within Eclipse does not use
> the javac compiler, but the Eclipse java compiler does an exceptionally good
> job of behaving very very much like the javac compiler does (and when it
> doesn't, we try hard to fix whichever one is wrong). As Darin says,
> regardless of compiler, the same libraries are used; for most UI code,
> therefore, the compiler makes no difference whatsoever, in the same sense
> that a Porsche in a traffic jam goes no faster than a Geo Metro.
>
>
Re: How do I change compilers so I can use javac? -- it is a forehead slapper... [message #242575 is a reply to message #242570] Sun, 08 April 2007 03:08 Go to previous message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Found my problem.

Either I forgot that update(Graphics g) clears the Canvas first
or I never knew it or I have been using Swing too much.

From Canvas:

public void update(Graphics g) {
g.clearRect(0, 0, width, height);
paint(g);
}

So I forgot to override it in my applet. ARRGGHHH...

In my applet:

public void update(Graphics g) {
paint(g);
}



DemonDuck wrote:
> Very helpful information. I've written a lot of
> Makefiles in the old UNIX days. ANT probably won't
> be all that hard to figure out. A dependency by any other name (or
> syntax) etc....
>
> I'm totally boggled by what I'm seeing with
> MemoryImageSource. I find no reported bugs in
> SUN's bugbase that is similar. I know it will be a
> forehead slapper when I find it.
>
> Thanks for the help.
>
> Walter Harley wrote:
>
>> "DemonDuck" <kwarner@uneedspeed.net> wrote in message
>> news:ev9ou8$447$1@build.eclipse.org...
>>
>>> Darin,
>>>
>>> Thanks. I wrote a .bat script by hand. Found out that there is
>>> no difference in behavior as you suggested. Will look and learn ANT
>>> so next time.....
>>>
>>> Will try compiling against the 1.4 classes. It must be something
>>> I'm doing wrong although I've done this a hundred times with success.
>>>
>>> Such is programming....
>>>
>>> BTW: Will Eclipse 3.2.1 support Java 1.6????
>>
>>
>>
>>
>> Eclipse 3.2.2 is the latest released version; Eclipse 3.3 is in
>> development. Eclipse 3.2.2 runs on a Java 1.6 VM just fine, and the
>> java compiler in Eclipse 3.2.2 supports most of Java 6's language
>> features, with a few exceptions that you most likely don't care
>> about. Eclipse 3.3 will fully support all of Java 6's features. But
>> since Java 6 contains only slight changes from Java 5, I strongly
>> suspect these distinctions are not relevant to anything you're doing.
>>
>> You can generate an Ant script (which will be a .xml, not a .bat) in
>> Eclipse with File -> Export -> General -> Ant Buildfiles. Inspecting
>> the resulting file will give you a bit of an introduction to Ant; to
>> get more, you could take a look at the online documentation for Ant,
>> or you could purchase the O'Reilly book. Ant resembles other make
>> systems in that an Ant script describes a set of dependencies and
>> actions: "file B depends on file A, and if it is out of date, perform
>> action X."
>>
>> Eclipse does not use Ant internally, but essentially everything that
>> Eclipse does during a build can be represented in terms of actions
>> driven by Ant dependencies. In particular, java compilation within
>> Eclipse does not use the javac compiler, but the Eclipse java compiler
>> does an exceptionally good job of behaving very very much like the
>> javac compiler does (and when it doesn't, we try hard to fix whichever
>> one is wrong). As Darin says, regardless of compiler, the same
>> libraries are used; for most UI code, therefore, the compiler makes no
>> difference whatsoever, in the same sense that a Porsche in a traffic
>> jam goes no faster than a Geo Metro.
>>
Previous Topic:Notifying java resources of new class files
Next Topic:Find file in package explorer
Goto Forum:
  


Current Time: Sun Jul 13 15:00:19 EDT 2025

Powered by FUDForum. Page generated in 0.05790 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top