#263 Static error: undefined class?

open
Other (56)
5
2014-08-20
2010-10-18
Levi Notik
No

I'm a total noob, trying to run the following program:

public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World!!");
}
}

I keep getting an error that

Static Error: Undefined class 'hello'

Can anyone help?

I'm using Win 7 with JDK 6 Update 22

Here is my system properties:

System Properties:
DrJava Version drjava-20100913-r5387
DrJava Build Time 20100913-2126

drjava.debug.port = 63624
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files\Java\jre6\bin
java.vm.version = 17.1-b03
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
sun.java.launcher = SUN_STANDARD
user.country = US
sun.os.patch.level =
java.vm.specification.name = Java Virtual Machine Specification
user.dir = <anonymized user.home>\Desktop\Java
java.runtime.version = 1.6.0_22-b04
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files\Java\jre6\lib\endorsed
os.arch = x86
java.io.tmpdir = <anonymized user.home>\AppData\Local\Temp\ line.separator = "\u000d\u000a"
java.vm.specification.vendor = Sun Microsystems Inc.
user.variant =
os.name = Windows 7
sun.jnu.encoding = Cp1252
java.library.path = C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\tt\ttm;C:\tt\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jre6\bin
java.specification.name = Java Platform API Specification
java.class.version = 50.0
sun.management.compiler = HotSpot Client Compiler
os.version = 6.1
user.home = <anonymized user.home>
user.timezone = America/New_York
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.6
java.class.path = <anonymized user.home>\Desktop\Java\DrJava.exe
user.name = <anonymized user.name>
java.vm.specification.version = 1.0
java.home = C:\Program Files\Java\jre6
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Sun Microsystems Inc.
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode, sharing
java.version = 1.6.0_22
java.ext.dirs = C:\Program Files\Java\jre6\lib\ext;C:\Windows\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\classes
java.vendor = Sun Microsystems Inc.
file.separator = \ java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
java.rmi.server.hostname = 127.0.0.1
sun.desktop = windows
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

DrJava configuration file
In resource bundle edu.rice.cs.drjava.config.options:
nothing

In shadowed configuration:
font.main = Courier New-16
font.line.numbers = Arial-14
key.delete.next = [shift DELETE]
key.delete.previous = [shift BACK_SPACE]
quit.prompt = false
save.before.compile = true
indent.level = 4
show.unchecked.warnings = false
window.x = 2697
window.y = 103
last.dir = C:\\Users\\&lt;anonymized user.name>\\Desktop\\Java\\hello.java
last.interactions.dir = C:\\Users\\&lt;anonymized user.name>\\Desktop\\Java
tabbedpanes.state = 2720 545 700 400

Used memory: about 29.33 megabytes
Free memory: about 9.80 megabytes
Total memory: about 39.13 megabytes
Total memory can expand to: about 247.50 megabytes

Number of processors/cores: 4

Compiler Discovery Log:
From config: not set
makeFromRuntime: compilerAdapter=edu.rice.cs.drjava.model.compiler.Javac160Compiler
attempt = JDK 6.0_22, isAvailable() = false
compiler=edu.rice.cs.drjava.model.compiler.NoCompilerAvailable
at least Java 6, try EclipseCompiler
version for Eclipse: Java 6.0
attempt = Eclipse Compiler 0.A48, isAvailable() = true
compiler=edu.rice.cs.drjava.model.compiler.EclipseCompiler
compiler found
compilers found: 1
From runtime: JDK library 6.0
Dir added: C:\Program Files\Java\jre6
Dir added: C:\Program Files\Java
Dir added: C:\Program Files
Dir added: C:\Program Files\Java
Dir added: C:\Program Files
Dir added: C:\Program Files\Java
Dir added: C:\Program Files
Dir not added: C:\Java
Dir added: <anonymized user.home>\Desktop\Java
Dir not added: C:\Java
Dir added: <anonymized user.home>\Desktop\Java
Dir not added: C:\System\Library\Frameworks\JavaVM.framework\Versions
Dir not added: C:\usr\java
Dir not added: C:\usr\j2se
Dir not added: C:\usr
Dir not added: C:\usr\local\java
Dir not added: C:\usr\local\j2se
Dir not added: C:\usr\local
Dir not added: C:\usr\lib\jvm
Dir not added: C:\usr\lib\jvm\java-6-sun
Dir not added: C:\usr\lib\jvm\java-1.5.0-sun
Dir not added: C:\usr\lib\jvm\java-6-openjdk
Dir not added: C:\home\javaplt\java\Linux-i686
File added: C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar
File not added: C:\Program Files\Java\jdk1.6.0_22\Classes\classes.jar
File not added: C:\Program Files\Java\lib\tools.jar
File not added: C:\Program Files\Java\Classes\classes.jar
File not added: C:\Program Files\JavaMint\langtools\dist\lib\classes.jar
File not added: C:\Program Files\JavaMint\langtools\dist\lib\tools.jar
File not added: C:\usr\local\soylatte\lib\classes.jar
File not added: C:\usr\local\soylatte\lib\tools.jar
File not added: C:\usr\local\JavaMint\langtools\dist\lib\classes.jar
File not added: C:\usr\local\JavaMint\langtools\dist\lib\tools.jar
MINT_HOME not set
File added: <anonymized user.home>\Desktop\Java\DrJava.exe
Result:
Found library: JDK library 6.0_22 at C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar, boot classpath: [C:\Program Files\Java\jdk1.6.0_22\jre\lib\alt-rt.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\deploy.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\javaws.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\management-agent.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar]
From search: JDK library 6.0_22 at C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar, boot classpath: [C:\Program Files\Java\jdk1.6.0_22\jre\lib\alt-rt.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\deploy.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\javaws.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\management-agent.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar, C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar]

Discussion

  • Mathias Ricken

    Mathias Ricken - 2010-10-18

    Java is case-sensitive. hello is not the same as Hello.

    Run your class using

    java Hello

    not using

    java hello

    I am refiling this as a support request, since it is not a bug in DrJava.

     
  • Mathias Ricken

    Mathias Ricken - 2010-10-18
    • status: open --> pending
     
  • Mathias Ricken

    Mathias Ricken - 2010-10-18
    • labels: --> Other
    • assigned_to: nobody --> mgricken
     
  • Levi Notik

    Levi Notik - 2010-10-18
    • status: pending --> open
     
  • Levi Notik

    Levi Notik - 2010-10-18

    Changing the save file to "Hello" from "hello" did the trick. The name of the .java file itself matters? (sorry for being an ignorant noob)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks