Operating System - HP-UX
1834093 Members
2333 Online
110063 Solutions
New Discussion

Re: Programs dont execute on my HP UX 11i V2.

 
SOLVED
Go to solution
eeriehunk
Occasional Contributor

Programs dont execute on my HP UX 11i V2.

Hi,
I have a HP-UX 11i V2 and we installed Java1.5 and 1.4 on it.
I also set the CLASSPATH and the PATH variables as per the HP-UX documentation. Just to be sure I set both PATH and CLASSPATH as '/opt/java1.4/bin' and then I did an 'export PATH' and 'export CLASSPATH' as follows:
'PATH=$PATH:.:/opt/java1.4/bin:/op
t/java1.4/jre/lib:/opt/java1.4'
'CLASSPATH=.:/opt/java1.4/bin:/opt/java1.4:/opt/java1.4/jre/lib
export CLASSPATH'
I am unable to compile java code from my user home. It keeps saying "java.lang.Error: Properties init: Could not determine current working directory".
Then when I try to compile it from the java source (that is /opt/java1.4/bin/>javac helloworld.java -d /home/project/username) it creates a .class file with no compilation errors. But when I try to run this .class file (that is opt/java1.4/bin>java /home/project/username/helloworld) it gives me an error 'Exception in thread "main" java.lang.NoClassDefFoundError: /home/project/username/helloworld.
I checked this helloworld program on my Windows machine and it works fine.
Kindly reply with a soln. I would be glad to give more infomation if needed.
Thanks in advance.
P.S: I have tied the same with java1.5 and I also posted a similar issue under the HP UX 11i under Programming and Scripts section before I realised there was a java forum. I apologize for the overload.
5 REPLIES 5
Murat SULUHAN
Honored Contributor

Re: Programs dont execute on my HP UX 11i V2.

Hi

Did you set JAVA_HOME variable. I am not developer but we use JAVA_HOME variable with tomcat as follows

export JAVA_HOME=/opt/java1.4

Best Regards
Murat
Murat Suluhan
Srini Jay
Valued Contributor

Re: Programs dont execute on my HP UX 11i V2.

Hi,
Like Murat suggested, set JAVA_HOME first.
And you cannot run Java programs with full path in the command line (like 'java /home/project/username/helloworld'). For details, refer to Java packages, Classpath, etc.

Try this:
cd /home/project/username
java helloworld
Srini Jay
Valued Contributor
Solution

Re: Programs dont execute on my HP UX 11i V2.

or you can do the following:

export CLASSPATH=/home/project/username:$CLASSPATH

java helloworld
eeriehunk
Occasional Contributor

Re: Programs dont execute on my HP UX 11i V2.

Thank you both, My problum has been resolved. First I did not use JAVA_HOME and then I was executing it wrong.
Regards,
eeriehunk
Murat SULUHAN
Honored Contributor

Re: Programs dont execute on my HP UX 11i V2.

Hi

don't forget the points

http://forums1.itrc.hp.com/service/forums/helptips.do?#28


Best Regards
Murat
Murat Suluhan