[program-java] Re: ANT and eclipse

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: "'program-java@xxxxxxxxxxxxx'" <program-java@xxxxxxxxxxxxx>
  • Date: Fri, 11 Feb 2011 08:20:11 -0500

Pranav:

This is only my opinion but since you are using an automated technology in this 
case Eclipse I would not use the ANT build approach. My ANT experience is only 
in the world of web development so anything I might say would be of question.

Now, yes I would create a new project in Eclipse and import what you need from 
the sample project. I myself just copy to and from the original source into a 
pseudo framework. Now as for running such a beast, you will need to determine 
the main and what I recommend is that you create a package under src that is 
titled main.... Note the lower case "m". With in same create a class Main.... 
Note the upper case "M". This makes tasks such as running easier because you 
merely need to specify main.Main as your entery point. Note once again the 
cases of "M" in that example.

Jim


James M. Corbett

Programmer / Analyst |
Canada Revenue Agency | Agence du revenue du Canada
875 Heron Rd.
Ottawa, On.
K1A0L5

James.Corbett@xxxxxxxxxxxxx
Telephone | Téléphone: (613) 941-1338
Facsimile | Télécopieur: (613) 941-2261

Government of Canada | Gouvernement du Canada

E = MC²

-----Original Message-----
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal
Sent: February 10, 2011 21:36
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: ANT and eclipse

Hi Jim,

The project is a desktop application. I am trying to compile an example that 
comes with the JfreeChart documentation. The way I am doing this is to just 
open the *.java file in eclipse and then build that file. When I hit
alt+r+r, I am asked to select the ANT configuration.

Do I need to create a specific project before I import the *.java file?
Pranav

-----Original Message-----
From: program-java-bounce@xxxxxxxxxxxxx
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Corbett, James
Sent: Thursday, February 10, 2011 10:22 PM
To: 'program-java@xxxxxxxxxxxxx'
Subject: [program-java] Re: ANT and eclipse

Pranav:

Is this a web project? If not, why are you using ANT?

Jim


James M. Corbett

Programmer / Analyst |
Canada Revenue Agency | Agence du revenue du Canada
875 Heron Rd.
Ottawa, On.
K1A0L5

James.Corbett@xxxxxxxxxxxxx
Telephone | Téléphone: (613) 941-1338
Facsimile | Télécopieur: (613) 941-2261

Government of Canada | Gouvernement du Canada

E = MC²

-----Original Message-----
From: program-java-bounce@xxxxxxxxxxxxx
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal
Sent: February 10, 2011 09:23
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] ANT and eclipse

Hi all,

I am trying to compile the source code of a demo that has come with the 
JfreeChart component. I have selected the ant build to be the build with 
default options. I am getting an error. The stack trace is below. What am I 
missing?
java.lang.NullPointerException
at org.eclipse.ant.internal.ui.AntUtil.isKnownAntFile(AntUtil.java:593)
at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(An
tLaunchShortcut.java:465)
at
org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.l
aunch(LaunchShortcutExtension.java:424)
at
org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(
ContextRunner.java:217)
at
org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.showShortcutSel
ectionDialog(ContextRunner.java:286)
at
org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch
(ContextRunner.java:140)
at
org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextR
unner.java:82)
at
org.eclipse.debug.internal.ui.actions.RelaunchLastAction.run(RelaunchLastAct
ion.java:77)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:
229)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(Action
ContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionI
tem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContribu
tionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.
java:115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAp
pLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at 
java.lang.reflect.Method.invoke(Unknown Source) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)






Other related posts: