Not able to compile with the new Java SDK 5 (1.5.0)

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
cathrop
Posts: 2
Joined: Wed Oct 29, 2003 5:22 pm

Not able to compile with the new Java SDK 5 (1.5.0)

Post by cathrop »

Just installed the new Java SDK 5 (1.5.0), have set up my classpath correctly and can both compile and run from the DOS command line. From Textpad I am able to run already compiled programs but am not able to compile. I had the same problem with the previous Java SDK (1.4.2). Here are the error messages I get when I compile:

.\java\io\ObjectOutputStream.java:26: cannot find symbol
symbol : class ObjectOutputStreamDelegate
location: package sun.io
import sun.io.ObjectOutputStreamDelegate; // RMI over IIOP hook.
^
.\java\io\ObjectInputStream.java:28: cannot find symbol
symbol : class ObjectInputStreamDelegate
location: package sun.io
import sun.io.ObjectInputStreamDelegate; // RMI over IIOP hook.
^
.\java\io\ObjectOutputStream.java:154: cannot find symbol
symbol : class ObjectOutputStreamDelegate
location: package sun.io
if (this instanceof sun.io.ObjectOutputStreamDelegate && this.getClass().getClassLoader() == null) {
^
.\java\io\ObjectOutputStream.java:196: cannot find symbol
symbol : class ObjectOutputStreamDelegate
location: class java.io.ObjectOutputStream
((ObjectOutputStreamDelegate) this).writeObjectDelegate(obj);
^
.\java\io\ObjectOutputStream.java:367: cannot find symbol
symbol : class ObjectOutputStreamDelegate
location: class java.io.ObjectOutputStream
((ObjectOutputStreamDelegate) this).defaultWriteObjectDelegate();
^
.\java\io\ObjectOutputStream.java:514: cannot find symbol
symbol : class ObjectOutputStreamDelegate
location: class java.io.ObjectOutputStream
return ((ObjectOutputStreamDelegate) this).enableReplaceObjectDelegate(enable);
^
.\java\io\ObjectInputStream.java:174: cannot find symbol
symbol : class ObjectInputStreamDelegate
location: package sun.io
if (this instanceof sun.io.ObjectInputStreamDelegate && this.getClass().getClassLoader() == null) {
^
.\java\io\ObjectInputStream.java:228: cannot find symbol
symbol : class ObjectInputStreamDelegate
location: class java.io.ObjectInputStream
return ((ObjectInputStreamDelegate) this).readObjectDelegate();
^
.\java\io\ObjectInputStream.java:469: cannot find symbol
symbol : class ObjectInputStreamDelegate
location: class java.io.ObjectInputStream
((ObjectInputStreamDelegate) this).defaultReadObjectDelegate();
^
.\java\io\ObjectInputStream.java:651: cannot find symbol
symbol : class ObjectInputStreamDelegate
location: class java.io.ObjectInputStream
return ((ObjectInputStreamDelegate) this).enableResolveObjectDelegate(enable);
^
.\java\security\Security.java:244: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
Enumeration enum = providers.elements();
^
.\java\security\Security.java:411: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
Enumeration enum = providers.elements();
^
.\java\security\Security.java:412: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
while (enum.hasMoreElements()) {
^
.\java\security\Security.java:413: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
Provider prov = (Provider)enum.nextElement();
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
14 errors

Tool completed with exit code 1
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

.\java\io\ObjectOutputStream.java:26: cannot find symbol

looks like your class path is not ok.

.\java\security\Security.java:244: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
Enumeration enum = providers.elements();

enum is a new java keyword in Java 1.5 - you have to change your sources or compile them with the suggested options in 1.4 mode.
cathrop
Posts: 2
Joined: Wed Oct 29, 2003 5:22 pm

Post by cathrop »

here is my classpath:
.;c:\Program Files\IBM\WebSphere MQ\Java\lib\providerutil.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mqjms.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\ldap.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\jta.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\jndi.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\jms.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\connector.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\fscontext.jar;c:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;C:\$User\JARs\mail.jar;C:\$User\JARs\imap.jar;C:\$User\JARs\mailapi.jar;C:\$User\JARs\pop3.jar;C:\$User\JARs\smtp.jar;C:\$User\JARs\activation.jar;.;C:\Program Files\SQLLIB\java\db2java.zip;C:\Program Files\SQLLIB\java\runtime.zip;C:\Program Files\SQLLIB\bin;C:\Program Files\Java\jdk1.5.0\bin


and here is the program I am trying to compile, as you can see, there is reference to ENUM in it:


public class HelloWorldSimple {

public static void main (String [] args) {

System.out.println("Hello World!!!");

}

}
Post Reply