I'm a noob linux user who thought it'd be pretty sweet to take an intro to programming prerequisite course for a master's program on a linux based system. Made sense at the time, use on operating system based on the premise that you'll be using the command line frequently to take a course where you'll be running your programs from the command line. Around the end of week two, and I started having some serious issues w/ my programs. Basically, any program that has to do any type of calculation (rather than just print string values I set initially for their respective variables), I get two intermittant errors.
Exception in thread "main" java.lang.NumberFormatException: invalid character at position 1 in uninitializedValue
at java.lang.Integer.parseInt(libgcj.so.10)
at java.lang.Integer.parseInt(libgcj.so.10)
at CollegeAdmission.main(CollegeAdmission.java:21)
icetherapy@Frodo:~/Documents/intro_prog/smith_Ch3$
The error is so intermittant I can't actually tell you what criteria to provide to get it. Numbers under 50 seem to trigger it more often though. I'll post the actual java code for that particular file in a second post. There is a second error I haven't been able to reproduce as a standard user tonight, but I got it to come up logged in as root:
Exception in thread "main" java.lang.NoClassDefFoundError: CollegeAdmission.
at gnu.java.lang.MainThread.run(libgcj.so.10)
Caused by: java.lang.ClassNotFoundException: CollegeAdmission. not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:/home/icetherapy/Documents/intro_prog/smith_Ch3/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.10)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at gnu.java.lang.MainThread.run(libgcj.so.10)
Things I've tried to do to fix it:
Entered the following into my .bashrc profile in an attempt to set the classpath. I spotted the JAVA_HOME bit in a thread and thought it worth a shot since I've been at this on and off for over two weeks with no success
# 5th attempt at adding CLASS_PATH to .bashrc profile
export CLASSPATH=$CLASSPATH:~/Documents/intro_prog/smith_Ch3
JAVA_HOME=~/etc/java-6-sun export JAVA_HOME
Things I think I may have screwed up:
This is on Debian Squeeze, I went with a simple non-partitioned graphical install, and installed the JDK using they synaptic package manager. Normally, it looks like people have Java installed in their /bin directory, but mine ended up in /etc after the automated install
pwd returns: /etc/java
The class definition error makes me think that it's something to do with my CLASSPATH variable, but even when I set it in .bashrc to the directory the .class files are housed in, that error still returns. I feel like the integer parse error has something to do with not having installed everything, but I'm really just making that up, as I have no definitive proof.
I will say that it's been kind of fun to troubleshoot, and that I've been learning a lot mashing through man pages and the Intro to Linux guide, but I'm starting to get a bit behind in my coursework so I'm throwing in the towel and asking for a bit of help :P
Tried everything I could from this thread and those linked @ the bottom