Hello!
I get compile error when compiling using the command javac from the command
terminal window(CMD).
I have just two classes which are called HelloWorld.java and Slask.java.
I have both classes in the directory called temp and I do cd temp to this
directory.
Then I do javac HelloWorld.java
Now I get the compile error
HelloWorld.java:8 cannot resolve symbol
symbol : class Slask
location: class helloWorld
Slask slask = new Slask(); //And the top sign is pointing at the first
Slask
HelloWorld.java:8 cannot resolve symbol
symbol : class Slask
location: class HelloWorld
Slask slask = new Slask(); //And the top sign is pointing at the last
Slask
If I use for example the Blue J IDE than it works or if I put these two
files in a project and compile with
Microsoft visualStudio J# it also works. But why do I get compile error when
using the javac from the terminal window(cmd)
import java.io.*;
public class HelloWorld
{
private String out;
public HelloWorld()
{
Slask slask = new Slask();
out = "Hello world";
}
public void printHelloWorld()
{
System.out.println("skriver ut:" + out);
}
public static void main(String args[])
{
HelloWorld hw = new HelloWorld();
hw.printHelloWorld();
}
}
import java.io.*;
public class Slask
{
private String out;
public Slask()
{
out = "slask";
}
public void printslask()
{
System.out.println("skriver ut:" + out);
}
}
//Tony