aspose file tools*
The moose likes Beginning Java and the fly likes Problem using javac: cannot find symbol(method) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem using javac: cannot find symbol(method)" Watch "Problem using javac: cannot find symbol(method)" New topic
Author

Problem using javac: cannot find symbol(method)

Rob Sweeny
Greenhorn

Joined: Jan 14, 2010
Posts: 16
Hi All,

I've been able to compile my supporting class file FloatNumber, but not my main class, MainFloatNumber.

CODE:





DIRECTORY HIERARCHY:

C:\code\src\com\scjaexam\tutorial
C:\code\src\com\scjaexam\tutorial\floatnumbers
C:\code\classes\com\scjaexam\tutorial
C:\code\classes\com\scjaexam\tutorial\floatnumbers

JAVAC:

c:\code>javac -d classes c:\code\src\com\scjaexam\tutorial\floatnumbers\FloatNumber.java
___compiles, and puts class file in correct location
___C:\code\classes\com\scjaexam\tutorial\floatnumbers\FloatNumber.class

c:\code>javac -d classes -cp classes c:\code\src\com\scjaexam\tutorial\MainFloatNumber.java

c:\code\src\com\scjaexam\tutorial\MainFloatNumber.java:7: cannot find symbol
symbol : method FloatNumber(float)
location: class com.scjaexam.tutorial.MainFloatNumber
FloatNumber value = FloatNumber(1f);


Any help would be appreciated.
Rob
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19060
    
  40


If you want to instantiate an object, you should use the "new" operator.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using javac: cannot find symbol(method)