[leJOS 0.9] java.io.FileNotFoundException

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

[leJOS 0.9] java.io.FileNotFoundException

Postby legott » Mon Oct 10, 2011 12:00 pm

Hello, I'm getting a java.io.FileNotFoundException while downloading a simple HelloWorld-Programm. I don't know what to do. Where is my fault. Before I used leJOS 0.8.5 without problems. I've already installed the new eclipse Plugin. Downloading programs by using nxjcontrol.bat works. Instead of using the old lejosdl.bat like in the version before, I use nxjupload.bat.

Eclipse 3.6.0 says the following:
Found NXT: NXT 0016530C97B2
leJOS NXJ> Connected to NXT
java.io.FileNotFoundException: HelloWorld (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at lejos.nxt.remote.NXTCommand.uploadFile(NXTCommand.java:447)
at lejos.pc.tools.Upload.upload(Upload.java:51)
at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
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 lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)


When I start the program HelloWorld, the screen on my NXT shows:
Exception: 115
FExec
at: 530(15)
at: 327(9)
at: 594(96)
at: 69(4)
at: 71(55)


Thank you, legott.
legott
New User
 
Posts: 11
Joined: Wed Sep 16, 2009 8:05 am

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby legott » Mon Oct 10, 2011 12:18 pm

legott wrote:Hello, I'm getting a java.io.FileNotFoundException while downloading a simple HelloWorld-Programm. I don't know what to do. Where is my fault. Before I used leJOS 0.8.5 without problems. I've already installed the new eclipse Plugin. Instead of using the old lejosdl.bat like in the version before, I use nxjupload.bat.

Eclipse 3.6.0 says the following:
Found NXT: NXT 0016530C97B2
leJOS NXJ> Connected to NXT
java.io.FileNotFoundException: HelloWorld (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at lejos.nxt.remote.NXTCommand.uploadFile(NXTCommand.java:447)
at lejos.pc.tools.Upload.upload(Upload.java:51)
at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
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 lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)


Downloading programs by using nxjcontrol.bat works. When I start the program HelloWorld, the screen on my NXT shows:
Exception: 115
FExec
at: 530(15)
at: 327(9)
at: 594(96)
at: 69(4)
at: 71(55)


My little programm ist the simple HelloWorld-Program, not more:
Code: Select all
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello NXT");
}
}


The error is on two different computers - one with Windows XP and the other with Ubuntu 11.04.

Thank you for your help, legott.
legott
New User
 
Posts: 11
Joined: Wed Sep 16, 2009 8:05 am

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby gloomyandy » Mon Oct 10, 2011 1:48 pm

Not sure about your download problem, but the NXT exception indicates that the binary you are trying to run is either invalid or does not match the firmware you have installed on the NXT. Are you sure that the program is actually being linked correctly and that you are not using a .nxj file left over from a previous build? Have you updated the firmware on the NXT? Are you using the release version of 0.9.0 or is this some sort of snapshot? If you are using a snapshot then you must use all of the tools from that build (in particular you must use the jtools.jar file which provides the leJOS linker), and you must use the firmware from the same snapshot, you can no mix versions. Other things to check is that you are using the jar files from the build you have installed, so check things like the path files used to locate the tools etc. If possible make sure that you have deleted any previous install of leJOS. Are you sure you are using the latest Eclpise plugin? Previous versions included a build of leJOS which may be causing these problems...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby skoehler » Mon Oct 10, 2011 5:25 pm

legott wrote:Eclipse 3.6.0 says the following:
Found NXT: NXT 0016530C97B2
leJOS NXJ> Connected to NXT
java.io.FileNotFoundException: HelloWorld (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at lejos.nxt.remote.NXTCommand.uploadFile(NXTCommand.java:447)
at lejos.pc.tools.Upload.upload(Upload.java:51)
at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
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 lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)



I think instead of using the Eclipse plug-in, your running nxjupload.bat as an external tool. However, apparently the command you're command you're executing is something like "nxjupload HelloWorld", even though the file HelloWorld does not exist in the current working directory. If you managed to run the linker, it should have produced a file called HelloWorld.nxj which you can upload to the NXT by using the command"nxjupload HelloWorld.nxj". Notice the additional ".nxj" in the end.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby legott » Fri Oct 14, 2011 6:38 pm

Hello, thank you for your answers.

My version of lejos on my PC is leJOS NXJ 0.9.0 beta.
The plugin in eclipse is org.lejos.nxt.ldt.feature_0.9.0.201106192010.jar. The old version of this plugin was deleted. I have deleted any previous installs of lejOS on my PC.

On my lejos it looks like this:
Firmware version: 0.9.0(rev. 4498)
Menu version 0.9.0(rev.4725)

I've configured the eclipse upload as following:
Location: /opt/lejos_nxj/bin/nxjupload
Working Directory: ${workspace_loc:/CCWNXT/bin}
Arguments: ${java_type_name}

I've tried to run a class-file, not an nxj-file. If I do understand you correcty, in the new version nxj files are past and now the NXT should run class files.

Thank you, legott
legott
New User
 
Posts: 11
Joined: Wed Sep 16, 2009 8:05 am

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby skoehler » Fri Oct 14, 2011 6:52 pm

legott wrote:I've configured the eclipse upload as following:
Location: /opt/lejos_nxj/bin/nxjupload
Working Directory: ${workspace_loc:/CCWNXT/bin}
Arguments: ${java_type_name}


Here's the output of "nxjupload --help":
Code: Select all
usage: nxjupload [options] filename [more filenames]
options:
-b,--bluetooth          use bluetooth
-d,--address <address>  look for NXT with given address
-h,--help               help
-n,--name <name>        look for named NXT
-r,--run                start program (last file)
-u,--usb                use usb


You're supposed to specify a filename, not a java type name. Why do you expect that to work?

That said, use this config and it should work:
Location: /opt/lejos_nxj/bin/nxj
Working Directory: ${project_loc}
Arguments: -cp bin ${java_type_name}

leJOS is not able to run class files directly. You need to link them first. nxj is basically nxjlink+nxjupload.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: [leJOS 0.9] java.io.FileNotFoundException

Postby legott » Fri Oct 14, 2011 7:29 pm

Thank you, now I can upload and start my programs. You're great!
legott
legott
New User
 
Posts: 11
Joined: Wed Sep 16, 2009 8:05 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff