-
Member
Ridiculous Java problem
This is driving me nuts...
I am using a standard:
int x = Integer.parseInt(someString);
to parse a string read in from the console to an int.
This works fine when running/compiling in JBuilder (X), but when I run from either the jar, the class, or an executable, I get exceptions caused by the parseInt() method.
I'm guessing that this is an environmental thing rather than anything else, but I don't see how... I've checked >set java
... the exact same setup was running RMI, and the jre was happily working with jBoss to serve EJB2.0s...
Anybody got any clues at all?
Running Windows 2k and XP (test envs) with Java 1.4.05
Thanks!
-
Ultimate Member
int x = new Integer("someString").intValue();
-
Member
Thanks Doc - tried that out and was failing too. Problem is that JBX is running in the console with *NIX input (\n) from the return key, and obviously Windows runs with CR-LF (\r\n)...
Was under the impression that I'd told JBX how to behave, but apparently not... and can find no **** way to change this. Ah well... Eclipse looks better and better all the time...
wow... these forums '*' even "damn"? (Sorry, ascii'd it)...
better write an app called "damnware", then... :P
Last edited by Spardan; 04-14-2005 at 09:25 AM.
++Spardan++
-
Ultimate Member
too many kids with nothing better to do The mods have to protect their pureile little minds somehow
What string are you passing to the parseInt method? It might be worth making sure that you are only passing a String which can be parsed (I think you have it with the \r\n jobie).
-
Member
yeah, it's a \r\n thing. Strange that I can't configure Jbuilder to imitate an environment. Means I have two lines in my parser, one commented out when running in JB, and then compiled live to run in the console... handy
-
Member
tsk tsk. didn't your compiler tell you, there are no ridiculous problems, only ridiculous programmers!
in light of that, why not use a laser. evidently they can solve every problem facing humanity today: vision correction, tooth whitening, hair removal, sensing mouse moves, sensing arabs for nuking, invading weaker planets, burning naughty movies to hideable DVDs, etc etc.
-GM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|