Problem with pakage when compiling in command line [solved]

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

Moderators: 99jonathan, roger, imaqine

Problem with pakage when compiling in command line [solved]

Postby ChristopheNS » Sun Nov 24, 2013 5:44 pm

Hello,

A problem occurs during linking the samples programs. The problem seems to be the package name. If I remove it, it's worked...
NXJ is installesd on linux 12.04 64 bits. I would like to understand why it doesn't work !
Code: Select all
:/opt/lejos_nxj/samples/src/org/lejos/sample/helloworld$ nxjlink -v -o HelloWorld.java HelloWorld
js.tinyvm.TinyVMException: Class HelloWorld (file HelloWorld.class) not found in CLASSPATH /opt/lejos_nxj/bin/../lib/nxt/classes.jar:.
   at js.tinyvm.ClassRecord.getClassRecord(ClassRecord.java:855)
   at js.tinyvm.Binary.processClasses(Binary.java:362)
   at js.tinyvm.Binary.createFromClosureOf(Binary.java:309)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:97)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:48)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:134)
   at lejos.pc.tools.NXJLink.run(NXJLink.java:101)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:33)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:622)
   at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
   at lejos.pc.tools.NXJLink.main(NXJLink.java:28)


I have tried to link in the origin folder...

I thank you in advance for your help
Last edited by ChristopheNS on Sun Nov 24, 2013 6:44 pm, edited 1 time in total.
ChristopheNS
New User
 
Posts: 6
Joined: Sat Nov 23, 2013 2:43 pm

Re: Problem with pakage when compiling in command line

Postby gloomyandy » Sun Nov 24, 2013 5:56 pm

Why are you specifying HelloWorld.java as the output file, that is probably not a good idea? Have you actually compiled the program to a class file? Is that the standard HelloWorld sample? If so you need to specify the full name of the class...
org.lejos.sample.helloworld.HelloWorld
You need to be in the directory above the org dir when you do this...

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

Re: Problem with pakage when compiling in command line

Postby ChristopheNS » Sun Nov 24, 2013 6:19 pm

Thank you Andy for your answer.

I've proceed as follow :
nxjc HelloWorld.java under the helloworld folder
/opt/lejos_nxj/samples$ nxjlink -v -o HelloWorld.nxj org.lejos.sample.helloworld.HelloWorld

Same problem... I think I didn't understand what you explain me. Is it possible to explain me again and give an example please?

Thank in advance

Christophe
ChristopheNS
New User
 
Posts: 6
Joined: Sat Nov 23, 2013 2:43 pm

Re: Problem with pakage when compiling in command line

Postby gloomyandy » Sun Nov 24, 2013 6:31 pm

You need to run the nxjlink command from the root directory so the one containing org (in this case that will probably be /opt/lejos/samples/src).
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3890
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Problem with pakage when compiling in command line

Postby ChristopheNS » Sun Nov 24, 2013 6:37 pm

Thank you, I've managed to create HelloWorld.nxj whithout error and upload it whithout problem !

Thank you again for your quick answers and your help!!

Christophe
ChristopheNS
New User
 
Posts: 6
Joined: Sat Nov 23, 2013 2:43 pm


Return to NXJ Software

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests

more stuff