Sponsored Content
Homework and Emergencies Homework & Coursework Questions Java doesn´t find the CLASSPATH (System variable) Post 302991531 by antoniosarco on Monday 13th of February 2017 01:15:49 AM
Old 02-13-2017
export CLASSPATH=/your/stuff/

or preserving system wide settings:

export CLASSPATH=$CLASSPATH:/your/addition/

the only different from Windows in terms of path-separators, : instead of ;

For example

java -classpath /mydir/mylib.jar:/otherdir/otherlib.jar com.MyProgram -Xmx64m

wildcard in the classpath to add multiple jars


java -cp "Halo.jar:lib/*" ni.package.MainClass

Java Path and Java ClassPath

Anto

Last edited by antoniosarco; 02-13-2017 at 02:28 AM..
 

8 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

my sgi system doesn't come up

:( Hi there, I have an O2 sgi and the other day when I was restarting the system it didn't come up. The error message is: unable to open "si(0)disk(2)rdisk(0)partition(0)": no such device I was assuming a hardware problem, but not for sure. Is there any one who could kindly tell me what... (1 Reply)
Discussion started by: siavoush
1 Replies

2. Programming

exit status running java classpath in unix shell

I have a java classpath running inside of a unix shell script. During my testing it will error with lines that show an example like this below. java.io.FileNotFoundException error at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:129), ... (2 Replies)
Discussion started by: mmcds
2 Replies

3. Programming

regarding classpath java

Hi, I have a below command.... $JAVA_HOME/bin/java -cp "/usr/orabase/product/10.2.0/lib:/usr/java/javajar/common/sched.jar:/usr/orabase/product/10.2.0/jdbc/lib/ojdbc14_g.jar:/usr/orabase/product/10.2.0/jdbc/lib/classes12.jar" com.abrt.smart.Smart I want to know where the Smart.class is... (1 Reply)
Discussion started by: PRKS
1 Replies

4. Ubuntu

Trouble setting up Java classpath

Saw an error while setting up an application called i2phex: # ./run.sh java.lang.RuntimeException: Failed to initialize phex.net.repres.i2p.I2PPresentationManager at phex.common.ManagerController.initializeManagers(ManagerController.java:78) at phex.Main.main(Main.java:161)After... (0 Replies)
Discussion started by: Israel213
0 Replies

5. Programming

Classpath of JAVA

Hello, ABC question as I could not get a direct answer: How to locate the default IO class of JAVA? My question was triggered by the row in most java programimport java.io.* as I am very curious where the io class is located in my Mint14 (Ubuntu12.10). I am aware it is similar to use DBI in PERL,... (1 Reply)
Discussion started by: yifangt
1 Replies

6. UNIX for Advanced & Expert Users

Fedora java classpath

What is the proper way to set your java classpath? (0 Replies)
Discussion started by: cokedude
0 Replies

7. Solaris

Solaris: ldd doesn't find libraries in exported environment variable LD_LIBRARY_PATH

I have given the relevant details below. Why are the libraries in /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r are invisible to ldd? %setenv ... (3 Replies)
Discussion started by: old_as_a_fossil
3 Replies

8. Red Hat

Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-la

Have no idea on what the below error message is: Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher -buildfile build.xml dist. Any help? (3 Replies)
Discussion started by: gull05
3 Replies
javah(1)						      General Commands Manual							  javah(1)

NAME
javah - C header and stub file generator SYNOPSIS
javah [ options ] fully-qualified-classname ... javah_g [ options ] fully-qualified-classname ... DESCRIPTION
The javah command generates C header and source files that are needed to implement native methods. The generated header and source files are used by C programs to reference instance variables of an object from native source code. The .h file contains a structure definition whose layout parallels that of the corresponding class. The fields in the structure correspond to instance variables in the class. The name of the header file and the structure declared within it are derived from the name of the class. If the class passed to javah is inside a package, the package name is prepended to both the header file name and the structure name. Underscores ( _ ) are used as name delimiters. By default, javah creates a header file for each class listed on the command line and puts the files in the current directory. Use the -stubs option to create source files. Use the -o option to concatenate the results for all listed classes into a single file. The new native method interface, Java Native Interface (JNI), does not require header information or stub files. The javah command can still be used to generate native method function prototypes needed for JNI-style native methods. javah produces JNI-style output by default, and places the result in the .h file. The javah_g version is a non-optimized version of javah suitable for use with debuggers like jdb. OPTIONS
The following options are supported: -o outputfile Concatenates the resulting header or source files for all the classes listed on the command line into outputfile. Only the -o or -d option may be used. -bootclasspath path Specifies path from which to load bootstrap classes. By default, the bootstrap classes are the classes implementing the core Java 2 platform located in jre/lib/rt.jar and several other jar files. -classpath path Specifies the path javah uses to look up classes. Overrides the default of the CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for path is: .:<your_path> For example: .:/home/avh/classes:/usr/local/java/classes -d directory Sets the directory where javah saves the header files or the stub files. -force Specifies that output files should always be written. -help Prints help message for javah usage. -jni Causes javah to create an output file containing JNI-style native method function prototypes. This is the default output, so use of -jni is optional. -old Specifies the old JDK1.0-style header files should be generated. -stubs Causes javah to generate C declarations from the Java object file. -trace Tracing is no longer supported. Instead, use the -verbose:jni option of the virtual machine. -verbose Indicates verbose output and causes javah to print a message to stdout concerning the status of the generated files. -version Print out javah version information. -Joption Pass option to the Java virtual machine, where option is one of the options described on the man page for the java applica- tion launcher, java(1). For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying virtual machine. ENVIRONMENT VARIABLES
CLASSPATH Used to provide the system with a path to user-defined classes. Directories are separated by colons, for example, .:/home/avh/classes:/usr/local/java/classes SEE ALSO
java(1), javac(1), javadoc(1), javap(1), jdb(1) 13 June 2000 javah(1)
All times are GMT -4. The time now is 04:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy