Hi i am new to java and i have little knowledge of frameworks
I used Hibernate in my project and its works fine in windows but in linux if i compile its giving error: Could not find or load main class
check the below commands where i got stuck
--- created java_home and path -------
[root@saraswati ~]# echo $JAVA_HOME
/usr/java/jdk1.7.0_04/bin/java
[root@saraswati ~]# echo $PATH
/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0_04/bin
[root@saraswati ~]# cd /home/syslab/Downloads/src
[root@saraswati src]# ls
------- these are the .java files-------
Converter.java DataStorageHandler.java Hibernate.cfg.xml SensorReadings.hbm.xml UDPServer.java
ConvertReadings.java FetchCoeff.java SensorMapping.java SensorReadings.java
[root@saraswati src]# javac *.java
---- i am setting classpath inorder to compile .java files. lib folder contains all required libraries------
[root@saraswati src]# export CLASSPATH=/home/syslab/Downloads/lib/*
[root@saraswati src]# javac *.java
[root@saraswati src]# java UDPServer
Error: Could not find or load main class UDPServer
------- ths is the error i got -------
[root@saraswati src]# java *
Error: Could not find or load main class Converter.class
--------------------------------------
-------if i unset the classpath the code will run but it fails because of missing library files -------
[root@saraswati src]# unset CLASSPATH
[root@saraswati src]# java UDPServer
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at UDPServer.main(UDPServer.java:22)
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
at java.net.URLClassLoader$1.run(URLClassLoader.java: 366)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
... 1 more
------------- this is the error ------------------------------
can anyone solve this problem i am totally stuck in this
thanx in advance