I've recently switched to a mac book and am attempting to compile and run some of my old java scripts to figure out how everything works with the mac and terminal.
Anyhow while I use the javac command I am getting tons of errors. Very basic simple coding is giving me upwards of 100 errors for basic loops. What am I doing wrong?
Here is the my command:
Matthew-lastname-MacBook-Pro-2:~ Matt$ javac Documents/Professional/java/LabOneAssignment.java
Documents/Professional/java/LabOneAssignment.java:20: illegal character: \0
^
Documents/Professional/java/LabOneAssignment.java:20: illegal character: \0
^
Documents/Professional/java/LabOneAssignment.java:20: illegal character: \0
^
Documents/Professional/java/LabOneAssignment.java:20: illegal character: \0
(this error x 100 with ^ carrot gradually moving over)
Very very basic code I'm testing this with:
/**
* This is the main method for this class
*
*
* @author XXXXXX
* @param args
*/
public class LabOneAssignment {
public static void main(String[] args) {
int one;
String name;
one = 25;
name = "Fred";
System.out.println("The integer is: " + one + "\n"
+ "The name is: " + name);
}
}
here is some more info:
machine:~ Matt$ java -cp ./ testcheck.java
Exception in thread "main" java.lang.NoClassDefFoundError: testcheck/java
Caused by: java.lang.ClassNotFoundException: testcheck.java
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 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
would it make a difference if the files were written on windows in jEdit and then transferred to OSX? The path still points to them unless its an issue with the text file itself...