- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Java programs on HP-UX don't execute
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2007 03:44 AM
10-05-2007 03:44 AM
Java programs on HP-UX don't execute
I have a HP-UX 11i V2 and we installed Java1.5 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.5/bin' and then I did an 'export PATH' and 'export CLASSPATH' as follows:
'PATH=$PATH:.:/opt/java1.5/bin:/op
t/java1.5/jre/lib:/opt/java1.5'
'CLASSPATH=.:/opt/java1.5/bin:/opt/java1.5:/opt/java1.5/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.5/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.5/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.
- Tags:
- Java
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2007 06:26 AM
10-05-2007 06:26 AM
Re: Java programs on HP-UX don't execute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2007 09:38 AM
10-10-2007 09:38 AM
Re: Java programs on HP-UX don't execute
First, for the CLASSPATH variable, I would set it to 'CLASSPATH=.'. CLASSPATH only pertains to the location of .class files, and the other stuff isn't needed. Java will always find the core system classes.
However, the compile error 'could not determine the current working directory' is not a problem with the classpath; it looks more like a problem with the shell environment. For some reason, it seems the process cannot determine what the current working directory (".") is or cannot read the directory. When you compile using an absolute path with the "-d" option, this is avoided, because it over-rides the CLASSPATH. Either something is wrong with the shell or something is funny about the directory permissions.
The run-time error is a bit different. The JRE will ONLY look at the CLASSPATH environment variable, and interprets the command line as the name of a Java class. In this case, it is looking for a class named "/home/project/username/helloworld", in the current CLASSPATH, which is different than looking for a file named "/home/project/username/helloworld.class".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2007 09:50 AM
10-10-2007 09:50 AM
Re: Java programs on HP-UX don't execute
What about JAVAPATH or JAVA_PATH
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2007 02:38 AM
10-16-2007 02:38 AM
Re: Java programs on HP-UX don't execute
Regards,
eeriehunk