Results 1 to 8 of 8
  1. #1
    patriotaki is offline Member
    Join Date
    Nov 2016
    Posts
    4
    Rep Power
    0

    Default Doesnt Run on MAC OSX

    Im running netbeans on windows and when i run the .jar file on my friends mac osx laptop it doesnt work
    i get this error

    any ideas?

    Java Code:
    String path = "/Users"+"/stefanopedretti/iMacros";
            BufferedReader br = null;
            String sCurrentLine;
            String code="\n";
            
            
    br = new BufferedReader(new FileReader(path+"/list.txt"));
    while ((sCurrentLine = br.readLine()) != null) {
                                    int i=sCurrentLine.length();
                                    char c=sCurrentLine.charAt(i-1);
                                    if(c==' ')
                                        sCurrentLine=sCurrentLine.substring(0,i-1);
                                    sCurrentLine=sCurrentLine.substring(1);
                    code=code+sCurrentLine+"\n";
                }
    Writer fileWriter = new FileWriter(path+"/new.txt");
    fileWriter.write(code);
    fileWriter.close();

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Doesnt Run on MAC OSX

    The error message needs to be translated.
    Is there a catch block with a call to the printStackTrace() method that will show the full text of the error on the console.

    Also posted at: Board Message
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    patriotaki is offline Member
    Join Date
    Nov 2016
    Posts
    4
    Rep Power
    0

    Default Re: Doesnt Run on MAC OSX

    Quote Originally Posted by Norm View Post
    The error message needs to be translated.
    Is there a catch block with a call to the printStackTrace() method that will show the full text of the error on the console.

    Also posted at: Board Message
    it says : Check the console for the possible error messages
    Last edited by patriotaki; 11-08-2016 at 01:27 AM.

  4. #4
    patriotaki is offline Member
    Join Date
    Nov 2016
    Posts
    4
    Rep Power
    0

    Default Re: Doesnt Run on MAC OSX

    any ideas?

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Doesnt Run on MAC OSX

    You need to tell us what the message was (in English please). And from looking at your code
    you may want to read about the String.trim() method.

    You should also explain what you are trying to do.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Doesnt Run on MAC OSX

    it says : Check the console for the possible error messages
    Ok, what was shown in the console?
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    patriotaki is offline Member
    Join Date
    Nov 2016
    Posts
    4
    Rep Power
    0

    Default Re: Doesnt Run on MAC OSX

    Quote Originally Posted by Norm View Post
    Ok, what was shown in the console?
    Stefanos-MBP:Desktop stefanopedretti$ java testmac.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: testmac/jar
    Caused by: java.lang.ClassNotFoundException: testmac.jar
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    Stefanos-MBP:Desktop stefanopedretti$

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Doesnt Run on MAC OSX

    Stefanos-MBP:Desktop stefanopedretti$ java testmac.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: testmac/jar
    Caused by: java.lang.ClassNotFoundException: testmac.jar
    The java program is not able to find the class mentioned in the error message: testmac.jar

    To execute the code in a jar file the command line needs the -jar option:
    java -jar testmac.jar
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. 0.01 doesnt add correctly
    By bioa10 in forum New To Java
    Replies: 3
    Last Post: 08-21-2013, 08:21 AM
  2. HttpURLConnection doesnt quite cut it
    By chopficaro in forum Advanced Java
    Replies: 1
    Last Post: 08-23-2012, 10:16 PM
  3. it doesnt see my 'if' statements
    By bilsch01 in forum New To Java
    Replies: 4
    Last Post: 06-27-2012, 02:43 PM
  4. Applet doesnt start or it doesnt show
    By 3dprogger in forum Java Applets
    Replies: 2
    Last Post: 01-07-2011, 08:03 PM
  5. Replies: 7
    Last Post: 09-28-2010, 01:17 AM

Posting Permissions

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