Problem with compiling

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with compiling

kenner

Can anyone tell me what I am missing here?

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > nrc IsFile.nrx
NetRexx portable processor, version 3.01
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program IsFile.nrx
  === class IsFile ===
    method main(String[])
  6 +++ method main(a=String[]) public
    +++        ^^^^
    +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'
Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
        at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)
        at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)
        at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)
Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 6 more

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > cat IsFile.nrx
import java.io.File

class IsFile public
        properties

method main(a=String[]) public
    Do label CPC6
        say File.separator
    findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F
ile.separator||"anyfile.txt")
    say findFile.isFile()
    End CPC6



Kenneth Klein

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

Dave Woodman

Hi Kenneth,

 

Try as I may, I cannot reproduce this – I get the warning but not the exception...

 

What Java version are you using?

 

                Dave

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: 29 May 2012 21:24
To: IBM Netrexx
Subject: [Ibm-netrexx] Problem with compiling

 


Can anyone tell me what I am missing here?

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > nrc IsFile.nrx
NetRexx portable processor, version 3.01
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program IsFile.nrx
  === class IsFile ===
    method main(String[])
  6 +++ method main(a=String[]) public
    +++        ^^^^
    +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'
Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
        at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)
        at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)
        at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)
Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 6 more

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > cat IsFile.nrx
import java.io.File

class IsFile public
        properties

method main(a=String[]) public
    Do label CPC6
        say File.separator
    findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F
ile.separator||"anyfile.txt")
    say findFile.isFile()
    End CPC6



Kenneth Klein


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

Kermit Kiser
In reply to this post by kenner
Hi Kenneth;

There are two problems: The warning message is because you explicitly coded the main method and that method must be static in a NetRexx program (because it is called before any objects are created). The exception error means that the NetRexx compiler could not find the Java compiler for the final stage of the compile process.

Please run the following Java class on your compile system (download the class file and enter "java envirotest" from the file directory) and it should tell you where to find the Java compiler jar you need:

http://kenai.com/projects/netrexx-plus/downloads/download/Envirotest/envirotest.class

-- Kermit


On 5/29/2012 1:24 PM, [hidden email] wrote:

Can anyone tell me what I am missing here?

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > nrc IsFile.nrx
NetRexx portable processor, version 3.01
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program IsFile.nrx
  === class IsFile ===
    method main(String[])
  6 +++ method main(a=String[]) public
    +++        ^^^^
    +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'
Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
        at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)
        at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)
        at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)
        at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)
Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 6 more

C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16
 > cat IsFile.nrx
import java.io.File

class IsFile public
        properties

method main(a=String[]) public
    Do label CPC6
        say File.separator
    findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F
ile.separator||"anyfile.txt")
    say findFile.isFile()
    End CPC6



Kenneth Klein


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

kenner
In reply to this post by Dave Woodman

Welcome to the JavaTM 2 Standard Edition Runtime Environment.

This is what I get when I run Java Runtime out of the "all programs" menu.

This is my classpath:
 .
"C:\Program Files\Java\jre6\lib\ext\NetRexxC.jar"
"C:\Program Files\Java\jre6\lib\ext\tools.jar"
"C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip"
"C:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar"
"C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip"
"C:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar"
"C:\PROGRA~1\IBM\SQLLIB\bin"
"C:\PROGRA~1\IBM\SQLLIB\java\common.jar"
"C:\Program Files\Java\jre6\lib\ext\QTJava.zip"
"C:\Documents and Settings\keklein\REXX\NetRexx\lib\Rexx2Nrx.jar"
"C:\Documents and Settings\keklein\REXX\NetRexx\lib\NetRexxC.jar"
"C:\netrexxify\netrexxify.jar"

Kenneth Klein



"Dave Woodman" <[hidden email]>
Sent by: [hidden email]

05/29/2012 05:40 PM

Please respond to
IBM Netrexx <[hidden email]>

To
"'IBM Netrexx'" <[hidden email]>
cc
Subject
Re: [Ibm-netrexx] Problem with compiling





Hi Kenneth,
 
Try as I may, I cannot reproduce this – I get the warning but not the exception...
 
What Java version are you using?
 
                Dave
 
From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent:
29 May 2012 21:24
To:
IBM Netrexx
Subject:
[Ibm-netrexx] Problem with compiling

 

Can anyone tell me what I am missing here?


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> nrc IsFile.nrx

NetRexx portable processor, version 3.01

Copyright (c) RexxLA, 2011.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program IsFile.nrx

 === class IsFile ===

   method main(String[])

 6 +++ method main(a=String[]) public

   +++        ^^^^

   +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'

Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main

       at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)

       at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)

       at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)

Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main

       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

       at java.security.AccessController.doPrivileged(Native Method)

       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

       ... 6 more


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> cat IsFile.nrx

import java.io.File


class IsFile public

       properties


method main(a=String[]) public

   Do label CPC6

       say File.separator

   findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F

ile.separator||"anyfile.txt")

   say findFile.isFile()

   End CPC6




Kenneth Klein
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

kenner
In reply to this post by Kermit Kiser

Good call KK. I had recently "tweaked"my classpath. It compiles now. I'm still confused about the "main" method and constructors and instantiation. I've found the java tutorials and doc on oracle.com. Is there anything more suited to my level of understanding?




Kermit Kiser <[hidden email]>
Sent by: [hidden email]

05/29/2012 10:44 PM

Please respond to
IBM Netrexx <[hidden email]>

To
IBM Netrexx <[hidden email]>
cc
Subject
Re: [Ibm-netrexx] Problem with compiling





Hi Kenneth;

There are two problems: The warning message is because you explicitly coded the main method and that method must be static in a NetRexx program (because it is called before any objects are created). The exception error means that the NetRexx compiler could not find the Java compiler for the final stage of the compile process.

Please run the following Java class on your compile system (download the class file and enter "java envirotest" from the file directory) and it should tell you where to find the Java compiler jar you need:

http://kenai.com/projects/netrexx-plus/downloads/download/Envirotest/envirotest.class

-- Kermit


On 5/29/2012 1:24 PM,
kenneth.klein@... wrote:

Can anyone tell me what I am missing here?


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> nrc IsFile.nrx

NetRexx portable processor, version 3.01

Copyright (c) RexxLA, 2011.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program IsFile.nrx

 === class IsFile ===

   method main(String[])

 6 +++ method main(a=String[]) public

   +++        ^^^^

   +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'

Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main

       at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)

       at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)

       at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)

Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main

       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

       at java.security.AccessController.doPrivileged(Native Method)

       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

       ... 6 more


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> cat IsFile.nrx

import java.io.File


class IsFile public

       properties


method main(a=String[]) public

   Do label CPC6

       say File.separator

   findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F

ile.separator||"anyfile.txt")

   say findFile.isFile()

   End CPC6




Kenneth Klein



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive :
http://ibm-netrexx.215625.n3.nabble.com/

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

George Hovey-2
Kenneth,
I suspect any forum answers to this question will tend to raise more questions than they answer.  IMO you're on the right track with the Java Tutorial -- it's designed to present the needed info in logical order.

On Wed, May 30, 2012 at 9:14 AM, <[hidden email]> wrote:

Good call KK. I had recently "tweaked"my classpath. It compiles now. I'm still confused about the "main" method and constructors and instantiation. I've found the java tutorials and doc on oracle.com. Is there anything more suited to my level of understanding?




Kermit Kiser <[hidden email]>
Sent by: [hidden email]

05/29/2012 10:44 PM

Please respond to
IBM Netrexx <[hidden email]>

To
IBM Netrexx <[hidden email]>
cc
Subject
Re: [Ibm-netrexx] Problem with compiling





Hi Kenneth;

There are two problems: The warning message is because you explicitly coded the main method and that method must be static in a NetRexx program (because it is called before any objects are created). The exception error means that the NetRexx compiler could not find the Java compiler for the final stage of the compile process.

Please run the following Java class on your compile system (download the class file and enter "java envirotest" from the file directory) and it should tell you where to find the Java compiler jar you need:

http://kenai.com/projects/netrexx-plus/downloads/download/Envirotest/envirotest.class

-- Kermit


On 5/29/2012 1:24 PM,
[hidden email] wrote:

Can anyone tell me what I am missing here?


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> nrc IsFile.nrx

NetRexx portable processor, version 3.01

Copyright (c) RexxLA, 2011.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program IsFile.nrx

 === class IsFile ===

   method main(String[])

 6 +++ method main(a=String[]) public

   +++        ^^^^

   +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'

Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main

       at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)

       at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)

       at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)

Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main

       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

       at java.security.AccessController.doPrivileged(Native Method)

       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

       ... 6 more


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> cat IsFile.nrx

import java.io.File


class IsFile public

       properties


method main(a=String[]) public

   Do label CPC6

       say File.separator

   findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F

ile.separator||"anyfile.txt")

   say findFile.isFile()

   End CPC6




Kenneth Klein



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive :
http://ibm-netrexx.215625.n3.nabble.com/

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
"One can live magnificently in this world if one knows how to work and how to love."  --  Leo Tolstoy

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem with compiling

Dave Woodman

I agree that the Java Tutorial is excellent. As an addition to, but not a replacement for, there is http://math.hws.edu/javanotes/.

 

            Dave

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of George Hovey
Sent: 30 May 2012 14:34
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] Problem with compiling

 

Kenneth,
I suspect any forum answers to this question will tend to raise more questions than they answer.  IMO you're on the right track with the Java Tutorial -- it's designed to present the needed info in logical order.

On Wed, May 30, 2012 at 9:14 AM, <[hidden email]> wrote:


Good call KK. I had recently "tweaked"my classpath. It compiles now. I'm still confused about the "main" method and constructors and instantiation. I've found the java tutorials and doc on oracle.com. Is there anything more suited to my level of understanding?



Kermit Kiser <[hidden email]>
Sent by: [hidden email]

05/29/2012 10:44 PM

Please respond to
IBM Netrexx <[hidden email]>

To

IBM Netrexx <[hidden email]>

cc

Subject

Re: [Ibm-netrexx] Problem with compiling

 

 


Hi Kenneth;

There are two problems: The warning message is because you explicitly coded the main method and that method must be static in a NetRexx program (because it is called before any objects are created). The exception error means that the NetRexx compiler could not find the Java compiler for the final stage of the compile process.

Please run the following Java class on your compile system (download the class file and enter "java envirotest" from the file directory) and it should tell you where to find the Java compiler jar you need:

http://kenai.com/projects/netrexx-plus/downloads/download/Envirotest/envirotest.class

-- Kermit


On 5/29/2012 1:24 PM, [hidden email] wrote:

Can anyone tell me what I am missing here?


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> nrc IsFile.nrx

NetRexx portable processor, version 3.01

Copyright (c) RexxLA, 2011.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program IsFile.nrx

 === class IsFile ===

   method main(String[])

 6 +++ method main(a=String[]) public

   +++        ^^^^

   +++ Warning: 'main' method assumed static, as its only argument is type 'String[]'

Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main

       at org.netrexx.process.RxTranslator.compile(RxTranslator.nrx:618)

       at org.netrexx.process.NetRexxC.process(NetRexxC.nrx:239)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:165)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:154)

       at org.netrexx.process.NetRexxC.main2(NetRexxC.nrx:152)

       at org.netrexx.process.NetRexxC.main(NetRexxC.nrx:91)

Caused by: java.lang.ClassNotFoundException: sun.tools.javac.Main

       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

       at java.security.AccessController.doPrivileged(Native Method)

       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

       ... 6 more


C:\Documents and Settings\keklein\REXX+  Tue 05/29/2012 16:16

> cat IsFile.nrx

import java.io.File


class IsFile public

       properties


method main(a=String[]) public

   Do label CPC6

       say File.separator

   findFile = File File(" C: " ||File.separator|| " java-tutorial " ||File.separator|| " Test " ||F

ile.separator||"anyfile.txt")

   say findFile.isFile()

   End CPC6




Kenneth Klein



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive :
http://ibm-netrexx.215625.n3.nabble.com/

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




--
"One can live magnificently in this world if one knows how to work and how to love."  --  Leo Tolstoy


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/