Results 1 to 19 of 19
  1. #1
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default import ';' expected - why?

    Why do I get that error?

    Lines 6 and 7 are:
    import com.ti.ccstudio.scripting.environment_3.1.0.*;
    import com.ti.debug.engine_1.0.0.scripting.*;


    C:\Users\jaa\Documents\NetBeansProjects\DSS_test\s rc\dss_test\DSS_test.java:6: error: ';' expected
    import com.ti.ccstudio.scripting.environment_3.1.0.*;
    C:\Users\jaa\Documents\NetBeansProjects\DSS_test\s rc\dss_test\DSS_test.java:7: error: ';' expected
    import com.ti.debug.engine_1.0.0.scripting.*;
    Last edited by turboscrew; 04-17-2013 at 12:54 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,329
    Rep Power
    5

    Default Re: import ';' expected - why?

    It might be helpful if you would post at least the first 10-15 lines of your code.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    There is not much code. Here's the whole thing.

    I didn't find a nice way of showing the project tree. import ';' expected - why?-capture.png
    (I'm using netbeans.)

    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
    
     */
    
    import com.ti.ccstudio.scripting.environment_3.1.0.*;
    import com.ti.debug.engine_1.0.0.scripting.*;
    
    package dss_test;
    
    
    /**
     *
     * @author jaa
     */
    public class DSS_test {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
    	// Create our scripting environment object - which is the main entry point into any script and
            // the factory for creating other Scriptable ervers and Sessions
            ScriptingEnvironment env = ScriptingEnvironment.instance(); 
            DebugServer debugServer = null;
    	DebugSession debugSession = null;
     
    	try
    	{
    	    // Get the Debug Server and start a Debug Session
    	    debugServer = (DebugServer) env.getServer("DebugServer.1");
    	    debugServer.setConfig("C:/Users/jaa/user/CCSTargetConfigurations/USB_EVM.ccxml");
    	    debugSession = debugServer.openSession(".*");
                long nResult = debugSession.expression.evaluate("GEL_AdvancedReset(\"System Reset\")");
                // Load a program
    //	    debugSession.memory.loadProgram("C:/Program Files/Texas Instruments/ccsv4/scripting/examples/C64/modem/Debug/modem.out");
    	}
    	catch (Exception e)
    	{
                
            }
        }
    }
    Last edited by turboscrew; 04-17-2013 at 03:20 PM.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: import ';' expected - why?

    The package statement is the first thing in a class file.
    Before any import statements.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    It was that way originally:

    Java Code:
    package dss_test;
    
    import com.ti.ccstudio.scripting.environment_3.1.0.*;
    import com.ti.debug.engine_1.0.0.scripting.*;
    but the same thing happened.

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,329
    Rep Power
    5

    Default Re: import ';' expected - why?

    I can't tell what is going on, but recommend you put the package declaration first as explained and try again and post results.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: import ';' expected - why?

    'com.ti.ccstudio.scripting.environment_3.1.0'
    That can't be a package name, as a package level cannot start with a digit.
    It follows the same naming as variables in that respect.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    Quote Originally Posted by jim829 View Post
    I can't tell what is going on, but recommend you put the package declaration first as explained and try again and post results.

    Regards,
    Jim
    I did and the errors are the same.

  9. #9
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,329
    Rep Power
    5

    Default Re: import ';' expected - why?

    Nice Catch! Totally missed it.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: import ';' expected - why?

    Quote Originally Posted by jim829 View Post
    Nice Catch! Totally missed it.

    Regards,
    Jim
    So did I, since the incorrect positioning of the package statement was the more obvious error.
    Always go for the low hanging fruit, that's what I say...:)
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    Quote Originally Posted by Tolls View Post
    'com.ti.ccstudio.scripting.environment_3.1.0'
    That can't be a package name, as a package level cannot start with a digit.
    It follows the same naming as variables in that respect.
    That makes sense. So it wants a ";" before the ".1" since there is no directory named "1" ?

    Maybe I should ask TI?
    Their documentation says:

    First thing that is needed is to import all the necessary DSS packages. the 'Breakpoints' example uses APIs for the Debug Server and
    the below will import all the necessary packages:

    // Import all DSS packages for the Debug Server
    import com.ti.ccstudio.scripting.environment.*;
    import com.ti.debug.engine.scripting.*;
    They didn't have the numbers in the names. In my installation the numbers are there in the jar-file names.

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,305
    Blog Entries
    7
    Rep Power
    20

    Default Re: import ';' expected - why?

    I wonder if all those package like names in your .jar files are necessary; what does your documentation say about the names of those .jar files?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: import ';' expected - why?

    The jar file name != the package names.
    They're not related.
    Your jar file could be called bob.jar, for all Java cares.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #14
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,305
    Blog Entries
    7
    Rep Power
    20

    Default Re: import ';' expected - why?

    Quote Originally Posted by Tolls View Post
    Your jar file could be called bob.jar, for all Java cares.
    I always name my .jar files JosTheGreatest.jar or JosIsMagnificent.jar or JosIsBeautiful.jar; anything against it? hm?

    kindest regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    I didn't name the files. Texas Instruments did.

  16. #16
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    I copied the stuff in an other directory and removed the version numbering from the names, removed the old files and added
    the new ones, but:

    C:\Users\jaa\Documents\NetBeansProjects\DSS_test\s rc\dss_test\DSS_test.java:8: error: package com.ti.ccstudio.scripting.environment does not exist
    import com.ti.ccstudio.scripting.environment.*;
    C:\Users\jaa\Documents\NetBeansProjects\DSS_test\s rc\dss_test\DSS_test.java:9: error: package com.ti.debug.engine.scripting does not exist
    import com.ti.debug.engine.scripting.*;

    I think you have helped as much as you could.
    I think TI has now some explaining to do... ;-)
    1) What should the filenames really be?
    2) What should be included?
    3) What are the files? Libraries or classes?

    Thanks a lot for your effort. It was not wasted: I learned something new that many books probably don't warn you about. ;-)

  17. #17
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: import ';' expected - why?

    Why did you rename anything?
    I suspect you've broken it.
    All you had to do was change the import statements.
    If, after that, it couldn't find the packages/classes then you needed to check you classpath (eg the -cp switch for the compiler) and ensure that the TI jar file(s) are on there.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  18. #18
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    AHAH!
    Each of the files is a library that needs to be added in the libraries (one by one) of the (netbeans) project.

    Now it's working.

  19. #19
    turboscrew is offline Member
    Join Date
    May 2011
    Location
    Nokia, Finland
    Posts
    22
    Rep Power
    0

    Default Re: import ';' expected - why?

    I would have added to Tolls' reputation if the sile would have let me.
    Just have to settle with this posting instead - at least for now.
    (The name-thing lead me towards the solution.)


Similar Threads

  1. <identifier> expected
    By Keke101 in forum New To Java
    Replies: 8
    Last Post: 01-02-2012, 10:55 AM
  2. Replies: 4
    Last Post: 10-20-2011, 05:10 AM
  3. ')' and '(' expected
    By Bindlz in forum New To Java
    Replies: 4
    Last Post: 04-06-2011, 12:51 AM
  4. '{' expected
    By elliojonhy in forum New To Java
    Replies: 3
    Last Post: 12-01-2010, 09:26 PM
  5. ';' expected
    By lala in forum New To Java
    Replies: 2
    Last Post: 11-24-2010, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •