Re: getting java to compile and run
On 2005-11-03 01:38:28, Neil Dugan wrote:
> Hi,
>
> I have installed 'free-java-sdk' but it doesn't appear to have been
> setup correctly. When I ask it to comple a "hello world" type class
> (from a book) I get the following error message.
>
> ---cut---
> $ jikes app.java
> Found 1 system error:
>
> *** Semantic Error: You need to modify your classpath, sourcepath,
> bootclasspath, and/or extdirs setup. Jikes could not find package
> "java.lang" in:
> .
> ---cut---
>
> I look in '/usr/share/doc/free-jave-sdk/README' it sugjested that I set
> 'JAVA_HOME' to '/usr/lib/fjsk' doing this didn't change anything.
>
> If I use
> ---cut---
> $ jikes --bootclasspath /usr/lib/fjsdk/jre/lib/rt.jar app.java
> $ java app.class
> java.lang.ClassNotFoundException: app.class not found in
> java.lang.ClassLoader$1{urls=[file:/mnt/storage/share/neil/src/java/./],
> parent=null}
> at java.net.URLClassLoader.findClass (URLClassLoader.java:841)
> at java.lang.ClassLoader.loadClass (ClassLoader.java:360)
> at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1285)
> at java.lang.ClassLoader.loadClass (ClassLoader.java:304)
> at java.lang.VirtualMachine.main (VirtualMachine.java:99)
> ---cut---
>
> Can someone help me to get this working?
>
> Regards Neil.
It should work if you use:
$ javac app.java
Instead of calling jikes manually, and
$ java app
Instead of supplying the .class suffix.
Felix
--
Felix C. Stegerman <flx@hccnet.nl>
"Any sufficiently advanced bug is indistinguishable from a feature."
-- R. Kulawiec
Reply to: