By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Strange compile error

P: n/a
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)

I have reinstalled the java development kit 1.5 but I still get the same
compile errorr
I use Microsoft proffessionel.
Is it anyone out there that have a suggestion what I can do?

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
{
}

//Tony

Sep 11 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.