aspose file tools
The moose likes Java in General and the fly likes Setting CLASSPATH on a remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Setting CLASSPATH on a remote server" Watch "Setting CLASSPATH on a remote server" New topic
Author

Setting CLASSPATH on a remote server

Dieter Stryker
Greenhorn

Joined: Mar 21, 2009
Posts: 11
Hi:

I've written a few classes that are compiling fine on my local workstation. Some use the mysql-connector-java-5.0.3-bin.jar file and others are using the xercesImpl.jar file. They run fine on my local machine, but when I try to run the code on the remote server, I get the following error:

> javac XMLBuilder.java
XMLBuilder.java:12: package org.apache.xerces.dom does not exist
import org.apache.xerces.dom.*;
^
XMLBuilder.java:13: package org.apache.xml.serialize does not exist
import org.apache.xml.serialize.*;
^
XMLBuilder.java:137: cannot find symbol
symbol : class OutputFormat
location: class XMLBuilder
OutputFormat outputFormat = new OutputFormat("XML", "UTF-8", true);
^
XMLBuilder.java:137: cannot find symbol
symbol : class OutputFormat
location: class XMLBuilder
OutputFormat outputFormat = new OutputFormat("XML", "UTF-8", true);
^
XMLBuilder.java:139: cannot find symbol
symbol : class XMLSerializer
location: class XMLBuilder
XMLSerializer xmlSerializer = new XMLSerializer(fileWriter, outputFormat);
^
XMLBuilder.java:139: cannot find symbol
symbol : class XMLSerializer
location: class XMLBuilder
XMLSerializer xmlSerializer = new XMLSerializer(fileWriter, outputFormat);
^
6 errors



I tried setting my path variable with both the connector/j and xerces jars and my classes that only use the connector/j file are running fine. The above Unix output shows my issue with the xerces parser file, though.



I'm not good with Unix and don't know where I need to set my CLASSPATH. Can someone give me step-by-step instructions to fix this?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32694
    
    4
Too difficult a question for us beginners.
Moving.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Dieter Stryker wrote:I'm not good with Unix and don't know where I need to set my CLASSPATH. Can someone give me step-by-step instructions to fix this?

Start here: http://faq.javaranch.com/java/HowToSetTheClasspath


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Dieter Stryker wrote:Hi:

I'm not good with Unix and don't know where I need to set my CLASSPATH. Can someone give me step-by-step instructions to fix this?


A direct answer would be , login to unix and go to the home directory ( you should land there otherwise type 'cd' from anywhere) and edit .profile and Add your entry "jar" to the CLASSPATH variable( only difference in unix from windows is use : as separator).
Dieter Stryker
Greenhorn

Joined: Mar 21, 2009
Posts: 11
What, exactly, are the commands on the command line that I need to input to add the files. I'm not a unix guy at all
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26193
    
  66

Dieter Stryker wrote:What, exactly, are the commands on the command line that I need to input to add the files. I'm not a unix guy at all

Extracted from the document linked to above is



There's more on that page about typing it carefully, so I still recommend reading it.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



Setting CLASSPATH in prompt is temporary. Add your classpath in your .profile file and its permanent for that user. Also catch up some basic unix and vi commands to edit your '.profile'
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting CLASSPATH on a remote server
 
Similar Threads
errors generated when running Ant build file in Eclipse
Output directory listing to an XML
JSP and XML
Converting JDBC Statements into XML document using SAX or DOM
DOM : Set Encoding from Cp1252 to UTF-8