Freebsd Java path & classpath
Hi everybody,
I am new to the Freebsd env, and I am having trouble with compiling java code. Below is my system configurations. Note. I am able to compile and run the Hello World program., but when I import classes into my code I get "cannot resolve symbol".
The path and classpath are setup in the .cshrc file as I am using the csh shell.
%which java
/usr/local/jdk1.4.2/bin/java
%which javac
/usr/local/jdk1.4.2/bin/javac
%echo $CLASSPATH
/usr/local/jdk1.4.2/lib/tools.jar:/usr/local/jdk1.4.2/lib/dt.jar:/usr/local/jdk1.4.2/jre/lib/rt.jar:
%echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/local/jdk1.4.2/bin:/usr/X11R6/bin:/home/george/bin
set JAVA_HOME=/usr/local/jdk1.4.2
If anyone has any suggestions they are welcome. Thanks
I am pretty clueless on Freebsd but you might need to add .: to your Classpath or may be try to use the -classpath option in your command line:javac -classpath some_directory your_class.java
Similar Messages
-
Setting Path,Classpath in Mandrake 8.2
I have added the following lines to the .bashrc .bash_profile for my regular user
and /etc/profile and i still cannot find the java path with a regular user but using root i can
Shouldn't the /etc/profile allow all users to access the java directory?
export JAVA_HOME=/usr/local/j2sdk1.4.0/
export PATH=$PATH:$JAVA_HOME/bin/
export CLASSPATH=$JAVA_HOME/lib/
ThanksI'm in the same boat as you are. Did you ever get the java working??
-
Troubles with PATH/CLASSPATH
I have been trying to set up my PATH/CLASSPATH variables on my WINDOWS XP computer for quite some time but cant quite get it right. In the PATH variable, if I put the entry for the java SDK first, I can use java commands via cmd.exe but I cant use windows commands (such as ping). If I put the default entries at the begining then the java entry at the end, I can use windows commands, but not the java ones. Why does it only register the first entry on the list?
The CLASSPATH variable works fine.Possibly you are including a space " " in the expression?
They aren't allowed. Here's my path statement (on 98SE):
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.2_01\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
Copy and paste your statement here if you still have problems. -
Linux - j2sdk1.4.2_06 can't set path/classpath
I am struggling to get my java set up to write, compile and run some java programs, and honestly being a linux newbie the docs for such are somewhat confusing..
I am trying to break this down as simple as possible.
-I am logged into Linux as root.
-then download the j2sdk1.4.2_06 in the /USR/ dir
-I did chmod +x j2sdk1.4.2_06...
-then./j2sdk1.4.2_06...
it installed successfully.
but setting up the path classpath is different.
I would like two things:
for my mozilla browser to now be java enabled, AND
I would like to create a directory called javasrc to hold all my java source code
but I do not want to develop in root, I want any user to be able to use the javasrc directory and be able to compile and run the programs..
what exactly do I edit. someone said I need to edit a file in /ETC/PROFILE
I want to try this..but I dont think it is correct
export JAVA_HOME=/usr/j2sdk1.4.2_06
PATH=$HOME:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/X11:/sbin:/home/mqm/bin:$JAVA_HOME/bin
export PATHthanksI'd advice you to not touch CLASSPATH until you've studied how packages and classloading work. Until then it will just get on your way.
What comes to setting PATH, the file to modify in /etc depends on your distribution -- a least in some versions of SuSE /etc/profile is generated by a script and you are supposed to modify /etc/profile.local instead. You could also edit a file called ".bashrc" in your home directory. The manual page of bash explains the differences between using these files. If you modify /etc/profile you need to either start a new login shell or source the file for the change to have effect. The lines to write are:export JAVA_HOME=/usr/j2sdk1.4.2_06
export PATH=$PATH:$JAVA_HOME/bin -
Hi I am new to Linux classpath. I am using Fedora Core 5 which comes along with jdk1.4.2. I read one of the messages that are posted in another form and set the classpath in the linux in the /etc/profiles folder. The below code I added over there:
JAVA_HOME=/usr/java/jdk1.5.0_08
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/htmlconverter.jar:$JAVA_HOME/lib/jconsole.jar
export PATH CLASSPATH
Now when i run javac -version it is showing the below output.
javac 1.5.0_08
javac: no source files
But when I run java -version it is showing me the below output.
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I don't understand what mistake I am doing. Please guide me and i would like to know how it is showing 1.5 for javac version and 1.4.2 for java version.
Thanks in advance.
SrikanthThis has nothing to do with the classpath and all to do with the PATH.
Somewhere, you have a 1.4.2 JRE in the PATH, before the 1.5.0 JDK and it's JRE.
So if you call javac, it will execute 1.5.0's because the 1.4.2 JRE doesn't have it, but java will be 1.4.2's because that the first one it'll find. -
hello,
I'm trying to connect to my database but i have the following error :
"no suitable driver".
I think i've all configured well but i don't know what's the "classpath" for, and when i need it to get connected.
i've got a .classpath file which contains the following code :
<?xml version="1.0" encoding="UTF-8" ?>
- <classpath>
<classpathentry kind="src" path="" />
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
<classpathentry kind="lib" path="D:/exonum/projet/debut/driver/mysql-connector-java-3.1.7-bin.jar" />
<classpathentry kind="output" path="" />
</classpath>
What should i do to resolve my problem ? I would appreciate any explanations.
thanx
tamtamthat's a standalone application...
Here's the code for the connection
public static Connection getConnection() throws SQLException, IOException {
Properties props = new Properties();
FileInputStream in = new FileInputStream("G:/exonum/Projet/debut/database.properties");
props.load(in);
in.close();
String drivers = props.getProperty("jdbc.drivers");
if (drivers != null)
System.setProperty("jdbc.drivers", drivers);
String url = props.getProperty("jdbc.url");
String username = props.getProperty("jdbc.username");
String password = props.getProperty("jdbc.password");
return DriverManager.getConnection(url, username, password);
}and the file database.properties contains :
jdbc.drivers=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://url
jdbc.username=login
jdbc.password=******** -
Diferences between the java options -classpath and -Xbootclasspath
I have created several jar files containing my own clases using the j2skd 1.4.0
I am not understand the diferences between the following options:
1) Copying this files into the path .../j2re1.4.0/lib/ext/
2) Using the java option -Xbootclasspath/a
3) Using the java option -classpath
Options 1 and 2 works fine for using the clases on my jar files but I don�t understand why the option 3 is not working.
About my clases:
a) All are contained on a package example cvm.util
b) The class files that refers to this uses the directive:
"import cmv.util;"
c) Non of them replaces any original java class
Any suggestions?The following command:
java -cp c:\Work\java\Smartt\cvutil.jar;c:\Work\java\Smartt\stutil.jar -jar C:\work\java\smartt\STServer.jar SAPMOVS.STR PRE
Generates:
Exception in thread "main" java.lang.NoClassDefFoundError: cvm/st/ST
at STServer.<init>(STServer.java:66)
at STServer.main(STServer.java:56)
But if I replace the -cp option for -Xbootclasspath/a:
java -Xbootclasspath/a:c:\Work\java\Smartt\cvutil.jar;c:\Work\java\Smartt\stutil.jar -jar C:\work\java\smartt\STServer.jar SAPMOVS.STR PRE
It works fine!!
or if I copy the two jar files into the ../lib/ext path
Then it also works pefect!
Thanks in advance -
How to get tomcat installtion path, java path n documents path in a servlet
may someone help me get the folder and pathname for tomcat, java path and library path and also the pathname where the jsp documents are stored.
Thanks in advance
nullHave a look at System.getEnv(String) and System.getProperties();
String tomcatHome = System.getEnv("CATALINA_HOME");
Properties props = System.getProperties();
Enumeration<Object> keys = props.keys();
while(keys.hasMoreElements())
String key = (String) keys.nextElement();
String prop = System.getProperty(key);
System.out.println(key +" : " + prop);
} -
hi gurus
i am facing a problem while installing SAP IDES on my desktop(windows XP) but am facing the problem in JAVA PATH settings.
can anyobdy please tell me the step by step JAVA path settings to resolve my probem?
thanks in advance..go to Run
type - > regedit
in u r registry
select
HKEY_LOCAL_MACHINE
SOFTWARE
JAVASOFT
JAVARUNTIME ENVIRONMENT
JAVA 1.4.2_12
on the right side you will find path for Java_home
copy the same
go to mycomputer properties advanced environment variables create one entry
JAVA_HOME
<the copied text eg. C:\Program Files\Java\j2re1.4.2_13>
now go to cmd
type java
it should work
Please provide points if helpful
Regards
Balamurugan.P -
Hi Experts,
Trying to Deinstall the OBIEE 11g. OUI is not launching... after digging the issue find out that "Java RunTime Environment was not found".
But Java software is available at the specified path.
"C:\DOCUME~1\user\LOCALS~1\Temp\OraInstall2013-09-05_01-10-08PM\jre\bin\javaw.exe"
Can you please help me on this... The complete error is...
Oracle Universal Installer
The Java RunTime Environment was not found at C:\DOCUME~1\v859971\LOCALS~1\Temp\OraInstall2013-09-05_01-10-08PM\jre\bin\javaw.exe. Hence, the Oracle Universal Installer cannot be run.
Please visit http://www.javasoft.com and install JRE version 1.3.1 or higher and try again.
OK
ArjunHi Srini,
I have tried as you mentioned like installing Java in C:\Java... and I have tried the by setting the JRE_LOCATION of local path. No use of it.
tried with -jreloc and setting the java path in environment variables too.
As I understand, the problem i have seen at files copied path is not expected as required. Please see the path below...
C:\DOCUME~1\v859971\LOCALS~1\Temp\OraInstall2013-09-06_03-36-31PM\jre\bin\javaw.exe.
After running the Setup.exe -deinstall... temporary folder is creating with timestamp and all the required files are coping here...
"jre" folder also created and copied required java files directly into jre folder, but not in jre\bin folder.
folder path is like this
C:\DOCUME~1\v859971\LOCALS~1\Temp\OraInstall2013-09-06_03-36-31PM\jre\javaw.exe.
Setup application is expecting jre\bin\javaw.exe, but folder structure is created as jre\javaw.exe. There it is coming the issue.
I have even tried with copying all the files into bin folder and executed the setup.exe, it again creating a new temporary file
not able to resolve it... -
Path, classpath, java build path???
I am happy with what path and classpath does but what is java build path for? could someone point me in the direction of where I can find more info?
cool but the IDE also had a place where you could set the classpath. so is the java build path just like an extra way of setting up classes for different projects where the classpath in the IDE is used by all projects?
-
Getting the "Java path" defined in a Java JRE installation
Hallo!
I have already tried to get some help with this issue but am still unable to get the JRE operational.
What have I undertaken:
1. Uninstalled all previous platform modules
2. Removed all traces of previous plugins and registry entries
3. Re-installed latest level of Java JRE
When I now try to use the cmd.exe and input "java -version" the error message I get is that Java is unknown.
When I try to install the application for which I needed JRE, the installation hangs up with "Java not fully installed".
Is there any documentation which fully describes the process in steps an untrained user can understand?
Better still is there a tool which can monitor or test the installation to indicate where I may have gone adrift?
Any useful tips are welcome.
Kind regards, forkinpm.hi,
Check the classpath and path settings of envoirnement variables. may be u havent changed them. The java-version command searches the java from there only.
manik; -
Hello
i'm using tomcat 5.x -> 5.5.12
and editor: Textpad
when compiling: these are the errors:
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:11: cannot find symbol
symbol: class HttpServlet
public class Controller extends HttpServlet
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:13: cannot find symbol
symbol : class HttpServletRequest
location: class Controller
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:13: cannot find symbol
symbol : class HttpServletResponse
location: class Controller
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:13: cannot find symbol
symbol : class ServletException
location: class Controller
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:64: cannot find symbol
symbol : class HttpServletResponse
location: class Controller
private void sendPage(HttpServletResponse reply, String s_Resultaat) throws IOException
^
C:\Documents and Settings\Michelle & Bastiaan\Bureaublad\261139bl\Controller.java:16: cannot find symbol
symbol : class HttpSession
location: class Controller
HttpSession session = request.getSession();
^
.\DBConnection.java:10: package javax.servlet does not exist
import javax.servlet.*;
^
.\DBConnection.java:11: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
10 errors
these are my user variables:
JAVA_HOME C:\Program Files\Java\jdk1.5.0_12
TEMP %USERPROFILE%\Local Settings\Temp
TMP %USERPROFILE%\Local Settings\Temp
these are my system variables:
CLASSPATH .;C:\Program Files\Java\jdk1.5.0_12\lib\tools.jar;apache-tomcat-5.5.23/common/lib/servlet_api.jar
ComSpec %SystemRoot%\system32\cmd.exe
FP_NO_HOST_CHECK NO
NUMBER_OF_PROCESSORS 1
OS Windows_NT
Path C:\Program Files\Java\jdk1.5.0_12\bin;apache-tomcat-5.5.23/bin
PATHTEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 15 Model 2 Stepping 4, GenuineIntel
PROCESSOR_LEVEL 15
PROCESSOR_REVISION 0204
TEMP C:\WINDOWS\TEMP
TMP C:\WINDOWS\TEMP
windir C:\WINDOWS
can somebody help me?
gr. Bastiaan
The NetherlandsCLASSPATH .;C:\Program Files\Java\jdk1.5.0_12\lib\tools.jar;apache-tomcat-5.5.23/common/lib/servlet_api.jarThe second part of that is unlikely to be correct unless you are in a specific directory.
-
Configure Path/CLASSPATH/JAVA_HOME/TOMCAT_HOME
hi all. iM sorry mayb this topic has been posted several times. But iM still encountering some problems here might need the experts help out there. What i did initially was to open up the autoexec.bat files(iM using win98) and added this lines:
set CLASSPATH=C:\xerces-1_4_4\xerces.jar;C:\soap-2_2;C:\soap-2_2\lib\soap.jar;C:\jaf-1.0.1\activation.jar;C:\javamail-1.2\mail.jar;.;C:\jdk1.3.1\lib;C:\jdk1.3.1\lib\tools.jar;C:\jdk1.3.1\jre\lib;C:\tutorial\demo1;C:\tutorial\demo2;C:\tutorial\demo3;C:\jsse1.0.2\lib\jsse.jar;C:\jsse1.0.2\lib\jnet.jar;C:\jees1.0.2\lib\jcert.jar;C:\rhino\js.jar;C:\jakarta-tomcat-3.2.3\lib\servlet.jar;
PATH %PATH%;.;C:\jdk1.3.1\bin;C:\jakarta-tomcat-3.2.3\bin;C:\Winnt\System32;
SET JAVA_HOME=C:\jdk1.3.1
SET TOMCAT_HOME=C:\jakarta-tomcat-3.2.3
Ok... when i tried to run tomcat on the MSDOS command they said that "Out of environment space" and "check the value of TOMCAT_HOME" Help appreciated...You need to allocate more space to the DOS environment. How this is done varies by OS. Here's results of a forum search that probably has the information specific to your system.
http://search.java.sun.com/search/java/index.jsp?qp=&nh=100&qt=%2Bdos+%2B%22environment+size%22+-%22Replies%3A+0%22&col=javaforums&x=33&y=8
Fixing the space problem will probably resolve the Tomcat Home error, it's probably due to insufficient environment space. -
Simple question about JAVA path
Hi. I have a simple question , but I spent several hours trying to find an answer.
How do I know the location of the java executable which is used by Concurrent Manager.
I already know that running which java under application user will not give me the correct answerMaybe you can try like this:
public String getPath(){
Class cls=getClass();
String className=cls.getName();
String packageName=cls.getPackage().getName();
System.out.println(className);
System.out.println(packageName);
String newClassName=className.replaceAll("\\.", "/");
String resouceName=newClassName+".class";
System.out.println(resouceName);
URL url;
url=cls.getClassLoader().getResource(resouceName);
String path="";
path=url.getFile();
return path;
}
Maybe you are looking for
-
SharePoint Foundation 2013 - report / chart / Graph for Employee vacation.
In SharePoint Foundation 2013 I want to create a report / chart / Graph for Employee (Employee Id,Employee Name & Department) which will show month wise from which date to which date Employee are on vacation in particular department. I'm thinking to
-
ERROR 27 :: iPhone 5 16GB Won't Restore, Stuck in DFU mode
I continue to recieve error msg when trying to restore my iphone... (end of the loading iPhone firmware) As you show my itunes updater logs ======================================== 2014-02-14 14:46:09.341 [21904:15f8]: restore library built Jan 7 20
-
Hi Friends, i have seen routine option at extraction tab of info provider. Pls can any one explain me in which secenario we can write this one. Thanks in advance, Thanks& Regards, Ramnaresh. Edited by: ramnaresh porana on Dec 16, 2008 3:28 AM
-
Assignning Output type to Invoice/Po.
Ho Folks, is there any userexit in the Invoice print/po print for assigning the exact form to an output? I have different forms for each country right now. I would prefer not to setup an output type (email) for every country unless I have to. The be
-
How to make Marketing Plan/Campaign ELEMENTS visible in Marketing Calendar?
Hi, Does anyone know whether it's possible to show Marketing Plan Elements or Campaign Elements in the Marketing Calendar? Until now, I can only show Marketing Plans and Campaigns, no Elements... Regards, Jeroen