8 Replies Latest reply on Aug 16, 2006 8:10 AM by rockym

    Compiler wrong?

    rockym

      Hi. I hope this is the right forum but anyway I have a problem trying to run JBOSS, because the JAVA_HOME and JBOSS_HOME are well set, however when I run ant it appears the following : (by the way the OS is MAC OS X)
      :

      dup-148-221-108-165:~/desktop/workbook rodrigomartinezheredia$ cd ex04_1
      dup-148-221-108-165:~/desktop/workbook/ex04_1 rodrigomartinezheredia$ ant
      Buildfile: build.xml

      prepare:

      compile:
      [javac] Compiling 4 source files to /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/build/classes
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:8: illegal character: \64
      [javac] @Entity
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:9: illegal character: \64
      [javac] @Table(name="CABIN")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:18: illegal character: \64
      [javac] @Id
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:19: illegal character: \64
      [javac] @Column(name="ID")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:29: illegal character: \64
      [javac] @Column(name="NAME")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:39: illegal character: \64
      [javac] @Column(name="DECK_LEVEL")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:49: illegal character: \64
      [javac] @Column(name="SHIP_ID")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:59: illegal character: \64
      [javac] @Column(name="BED_COUNT")
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/domain/Cabin.java:68: expected
      [javac] }
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/travelagent/TravelAgentBean.java:9: illegal character: \64
      [javac] @Stateless
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/travelagent/TravelAgentBean.java:12: illegal character: \64
      [javac] @PersistenceContext(unitName="titan") private EntityManager manager;
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/travelagent/TravelAgentBean.java:12: expected
      [javac] @PersistenceContext(unitName="titan") private EntityManager manager;
      [javac] ^
      [javac] /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/src/main/com/titan/travelagent/TravelAgentRemote.java:7: illegal character: \64
      [javac] @Remote
      [javac] ^
      [javac] 13 errors

      BUILD FAILED
      /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/build.xml:54: Compile failed; see the compiler error output for details.


      I guess is the compiler but how can I repair the problem?,I think all is set thanks by the way

        • 1. Re: Compiler wrong?
          peterj

          Which version of the JDK are you using? You need a 5.0 JDK to build EJB3 code that uses annotations.

          • 2. Re: Compiler wrong?
            rockym

            Well I guess is the 1.5.0, but I'm not sure if the path is well defined, how can I confirm it?, sorry for those questions I'm new using Mac. Well if I have the rigth version,what could be the other problem?, It's an example that I downloaded from Workbook, so I haven't touched the classes ; it works well In a friend's machine

            thanks

            • 3. Re: Compiler wrong?
              peterj

              If you enter "which javac", what is the response? It should identify the javac in your 5.0 JDK. If it doesn't, you wil want to change the path so that the 5.0 JDK is referenced. (I don't have a Mac, but since the Mac is based on a Unix-like kernel, I assume that Unix type stuff applies.)

              The only other thing I can think of is a code page problem (code pages are language related). But I don't think that is the issue because the error message said the illegal character is \64, which is the ASCII code for '@'.

              • 4. Re: Compiler wrong?
                rockym

                Well I make the command "which javac"

                Rocky:~/desktop/workbook/ex04_1 rodrigomartinezheredia$ which /usr/bin/javac
                /usr/bin/javac

                it's in the path where the compiler it, the version is the 1.5.0 of JDK, so I'm not sure what to do, Im sure that is the right PATH in the rigth version


                Rodrigo Martinez

                • 5. Re: Compiler wrong?
                  juergen.zimmermann

                  "javac -version" yields the version number, e.g. 1.5.0_08

                  • 6. Re: Compiler wrong?
                    wolfc

                    Try:

                    $ java -version

                    It should say:
                    java version "1.5.0_06"
                    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
                    Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)
                    

                    If it says:
                    java version "1.4.2_09"
                    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232)
                    Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode)
                    

                    you're using the old version.

                    Either the wrong version is active (see http://docs.info.apple.com/article.html?artnum=303526) or you should install the J2SE update.

                    For PPC get the J2SE update here: http://www.apple.com/support/downloads/j2se50release4ppc.html
                    For intel here: http://www.apple.com/support/downloads/j2se50release4intel.html [/url]

                    Please post any followups in an Apple forum.

                    • 7. Re: Compiler wrong?
                      rockym

                      I finally did it there is no compile mistake anymore!!!, however now I found this when I give it ANT

                      Rocky:~/desktop/workbook/ex04_1 rodrigomartinezheredia$ ant
                      Buildfile: build.xml

                      prepare:

                      compile:

                      ejbjar:
                      [copy] Copying 1 file to /Applications/jboss/server/default/deploy

                      BUILD FAILED
                      /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/build.xml:69: Failed to copy /Users/rodrigomartinezheredia/Desktop/workbook/ex04_1/build/titan.jar to /Applications/jboss/server/default/deploy/titan.jar due to /Applications/jboss/server/default/deploy/titan.jar (Permission denied)

                      Total time: 3 seconds

                      • 8. Re: Compiler wrong?
                        rockym

                        Could it be that there is a problem in the build.xml???