• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting CLASSPATH on a remote server  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for us beginners.
Moving.
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Marshal
Posts: 37518
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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'
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!