Operating System - OpenVMS
1753830 Members
9056 Online
108806 Solutions
New Discussion юеВ

Re: Problem with Java Classes

 
SOLVED
Go to solution
Pallavi Akundi
Occasional Advisor

Problem with Java Classes

Hello,
We have recently installed JAVA on our VMS server. I am facing a peculiar problem with running JAVA programs. I am not able to name class files with case sensitive names.

Eg: I cannot have a class like "public class helloOpenVMS" because when the class file is compiled, it is being named HELLOOPENVMS.CLASS by the VMS operating system (in all caps).

When I execute the command "java helloOpenVMS", It throws an exception "Exception in thread "main" java.lang.NoClassDefFoundError: helloopenvms (wrong name: helloOpenVMS)"

Is it that we cannot use case sensitive names in JAVA with VMS or is there a way in which I can change this behavior by changing some system settings?

Regards,
Pallavi
People with goals succeed because they know where they are going-- as quoted by some one
10 REPLIES 10
Jan van den Ende
Honored Contributor

Re: Problem with Java Classes

Pallavi,

This is way to little info to go by!

Some questions first:

Alpha or IA64?
VMS version?
Java version?
ODS-2 or ODS-5 disks?

I have some suspicions, but without that info, it will by too much wild-guessing.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Hein van den Heuvel
Honored Contributor

Re: Problem with Java Classes

You have to work in an ODS-5 disk environment.
Check with your system manager how he can assign / move your files to a ODS-5 home on the system.

Hein.
labadie_1
Honored Contributor

Re: Problem with Java Classes

And if you can't have a ODS-5 disk, just dedicate some blocks from a disk to a LD device.

@sys$startup:ld$startup
LD create ldxxxx:...
Just init /struct=5 ldxxxx: /nohigh/maximum...
mount ld...
Chris Barratt
Frequent Advisor
Solution

Re: Problem with Java Classes

You should be able to do it simply with

$ java "helloOpenVMS"

ie. quotes just around the class name.
Of course, you should also make sure your .class file is in your current directory, or in your classpath.

There is documentation on the VMS web site on how to use Java on VMS which would help you get started with this.
Pallavi Akundi
Occasional Advisor

Re: Problem with Java Classes

Hello Jan, Hein and Labadie,

Thanks for the replies. To get started,

Alpha or IA64? - Alpha
VMS version? - 7-3.2
Java version? - 1.4.2
ODS-2 or ODS-5 disks? - We have some ODS-5 disks and some ODS-2, I have been trying this on the ODS-2.. I will have to try this on the ODS 5 disks.

Chris, Thanks, I will have to try the $ java "helloOpenVMS" and will post back what I get.

Thanks :)
Pallavi
People with goals succeed because they know where they are going-- as quoted by some one
Volker Halle
Honored Contributor

Re: Problem with Java Classes

Pallavi,

ODS-2 does not do mixed case or lower-case filenames, so you must use an ODS-5 disk for storing the JAVA class file.

Volker.
Chris Barratt
Frequent Advisor

Re: Problem with Java Classes

I don't think this is a filename issue. The problem is that the JVM cannot find the class. Hence by putting the name of the class in quotes, you can supply the correctly cased class name to the JVM.

From what I have seen, when it then looks for files containing the class, it does not worry about case of filenames. It compares what is in the quotes, with what is in the class (or your original .java code).

I have ben able to run Java on ODS-2 disks, once I worked out this fact.

It's been a while, though...
H_Bachner
Regular Advisor

Re: Problem with Java Classes

Also, be sure to have logical names DECC$ARGV_PARSE_STYLE and DECC$EFS_CASE_PRESERVE defined to "ENABLE". The Java SDK User Guide has more details about proper setup of your environment.

Hans.
Pallavi Akundi
Occasional Advisor

Re: Problem with Java Classes

Hi All,

I am really sorry for this great delay in response. I had to face some connectivity issues at my end and could not test.

But this is what I found and it is interesting.

I wrote a sample Java program with a class helloOpenVMS

Case 1 : In the ODS-2 Disk

The file is stored as HELLOOPENVMS.JAVA;1
$javac VOLXXX:[XXX]HELLOOPENVMS.JAVA

Throws an error: class helloOpenVMS is public, should be declared in a file named helloOpenVMS.java

$set def VOLXXX:[XXX]
$javac HELLOOPENVMS.JAVA

The program is compiled.

$java helloOpenVMS
Exception in thread "main" java.lang.NoClassDefFoundError: helloopenvms (wrong name: helloOpenVMS)

$java helloopenvms
Exception in thread "main" java.lang.NoClassDefFoundError: helloopenvms (wrong name: helloOpenVMS)

$java "helloOpenVMS"

works!

Case 2 : In the ODS-5 Disk
The file is stored as HELLOOPENVMS.JAVA;1
$javac VOLXXX:[XXX]HELLOOPENVMS.JAVA

Throws an error: class helloOpenVMS is public, should be declared in a file named helloOpenVMS.java

$set def VOLXXX:[XXX]
$javac HELLOOPENVMS.JAVA

The program is compiled.

$java helloOpenVMS
Exception in thread "main" java.lang.NoClassDefFoundError: helloopenvms (wrong name: helloOpenVMS)

$java helloopenvms
Exception in thread "main" java.lang.NoClassDefFoundError: helloopenvms (wrong name: helloOpenVMS)

$java "helloOpenVMS"

works!

The quotes technique definitely works. I could not decipher why the compilation fails when the complete path is specified but works when I set default to that directory and run the compile command.

I am not a VMS admin person so may be this question sounds silly. The file names are always stored in all caps on my system. Whereas in the newly installed ODS-5 disks, some names like the names of some folders in the CSW server (for which i had the ODS-5 installed in the first place) are stored preserving the case (in small case). But if I create a new file in the same ODS-5 disk, it has the name in all caps! Why does this happen?

As Info the logical for DECC$ARGV_PARSE_STYLE is not defined on my machine whereas, the logical for DECC$EFS_CASE_PRESERVE has been set to "TRUE"

People with goals succeed because they know where they are going-- as quoted by some one