You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by administrator <ad...@revoltingdigits.com> on 2004/08/30 14:16:00 UTC

problems launching a java console application from ant

Hello all,

I have a java console application which asks a number of questions to 
the user and stores their
responses using the java Preferences API in order to configure an open 
source web application.

The problem is that if I try to run it this way

        <java classname="ie.jestate.Prefs" fork="true" dir="${basedir}" >

I get this ....

configure:
     [java] Welcome to the jestate configuration program !
     [java] Please choose one of the following
     [java] Press 'c' to Change settings
     [java] Press 'p' to Print current settings
     [java] Press 'd' to view Default settings
     [java] Press 's' to Set system to default settings
     [java] Press 'e' to exit
     [java] java.lang.NullPointerException
     [java] at ie.jestate.Prefs.runIntroduction(Prefs.java:165)
     [java] at ie.jestate.Prefs.<init>(Prefs.java:71)
     [java] at ie.jestate.Prefs.main(Prefs.java:37)
     [java] Exception in thread "main"
     [java] Java Result: 1

If I run it this way ....

    <java classname="ie.jestate.Prefs" fork="true" dir="${basedir}" >

I get this 

configure:
     [java] Working directory ignored when same JVM is used.
     [java] Welcome to the jestate configuration program !
     [java] Please choose one of the following
     [java] Press 'c' to Change settings
     [java] Press 'p' to Print current settings
     [java] Press 'd' to view Default settings
     [java] Press 's' to Set system to default settings
     [java] Press 'e' to exit
     [java] java.io.EOFException: No input provided for project
     [java] at org.apache.tools.ant.Project.defaultInput(Project.java:1117)
     [java] at org.apache.tools.ant.Task.handleInput(Task.java:306)
     [java] at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:599)
     [java] at 
org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:210)
     [java] at org.apache.tools.ant.Project.demuxInput(Project.java:1139)
     [java] at 
org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:63)
     [java] at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
     [java] at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
     [java] at sun.nio.cs.StreamDecoder.read(Unknown Source)
     [java] at java.io.InputStreamReader.read(Unknown Source)
     [java] at java.io.BufferedReader.fill(Unknown Source)
     [java] at java.io.BufferedReader.readLine(Unknown Source)
     [java] at java.io.BufferedReader.readLine(Unknown Source)
     [java] at ie.jestate.Prefs.runIntroduction(Prefs.java:164)
     [java] at ie.jestate.Prefs.<init>(Prefs.java:71)
     [java] at ie.jestate.Prefs.main(Prefs.java:37)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)
     [java] at java.lang.reflect.Method.invoke(Unknown Source)
     [java] at 
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:196)
     [java] at 
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:133)
     [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:661)
     [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:

And if I run it this way  ....

<java classname="ie.jestate.Prefs" fork="true" dir="${basedir}"  
spawn="true">

I get this  ....

Buildfile: C:\NitroX\eclipse\workspace\jestatev1\build.xml
default:
configure:
BUILD SUCCESSFUL
Total time: 2 seconds

The application never appears .....

Is there any way arround this. I could provide shell and batch scripts 
to run this but I am trying to get more
developers into my project and I would like to try and keep it as simple 
as possible for them to get started.

Best Regards
Bryan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org