Could not find the OffLine WLST class (WL 10.3)
Hi,
I am confused about this scenario, please help me.
I keep getting the below when I run the wlst.sh script.
Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class
So what I did was add weblogic.jar to the classpath in the script. But I still get the same error. However, if I run it from the command line without the -D option, I no longer get that error, but get one about abother missing class.
Here is my wlst.sh
# cat wlst.sh
#!/bin/sh
# set up WL_HOME, the root directory of your WebLogic installation
WL_HOME="/exec/products/weblogic/v10.3/bea/wlserver_10.3"
# set up common environment
. "${WL_HOME}/server/bin/setWLSEnv.sh"
CLASSPATH="${CLASSPATH}:${WL_HOME}/common/eval/pointbase/lib/pbembedded57.jar:${WL_HOME}/common/eval/pointbase/lib/pbtools57.jar:${WL_HOME}/common/eval/pointbase/lib/pbclient57.jar:${WL_HOME}/server/lib/weblogic.jar"
echo
echo CLASSPATH=${CLASSPATH}
"${JAVA_HOME}/bin/java" -Dprod.props.file=${WL_HOME}/.product.properties weblogic.WLST $*and here is the properties file it is using
# cat ${WL_HOME}/.product.properties
#Mon Nov 30 13:34:33 CET 2009
JAVA_HOME=/usr/java6_64
WLS_JAVA_HOME=/usr/java6_64
JAVAHOME=/usr/java6_64
PLATFORMHOME=/exec/products/weblogic/v10.3/wlserver_10.3
WLS_INSTALL_DIR=/exec/products/weblogic/v10.3/wlserver_10.3
javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
java.vm.version=2.4
LOCALE=en
CONFIGWIZ_HOME=/exec/products/weblogic/v10.3/wlserver_10.3
java.vm.vendor=IBM Corporation
javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
WLS_JAVA_VENDOR=Unknown
javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
DOCSWEBROOT=http\://e-docs.bea.com/wls/docs103
NODEMGR_PORT=5556
BEAHOME=/exec/products/weblogic/v10.3/bea
WL_HOME=/exec/products/weblogic/v10.3/bea/wlserver_10.3So to sum up, when after adding weblogic.jar to the classpath, I still get the same error if I run the script where it uses the properties file.
However, if I run it without using the properties file, then I get
# java weblogic.WLST
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic.descriptor.DescriptorClassLoader
at weblogic.WLST.main(WLST.java:19)
Caused by: java.lang.ClassNotFoundException: weblogic.descriptor.DescriptorClassLoader
at java.net.URLClassLoader.findClass(URLClassLoader.java:421)
at java.lang.ClassLoader.loadClass(ClassLoader.java:652)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
... 1 moreSo any ideas on how to get this working would be appreciated.
Hi,
If you need access to WebLogic container code on top of WLST scripting API such as the scenario where a plain SE Java class needs to call a remote method on a Stateless/Stateful session bean for example - I find it is easier to include the generated wlfullclient.jar - just don't use this jar in an application managed servlet context.
For non-EE/ejb/web contexts (SE) use wlfullclient.jar generated from
$WLS_INSTALL\wlserver_10.3\server\lib>java -jar wljarbuilder.jarThen run your client with the above jar in the classpath like
java -cp .;wls/wlfullclient.jar org.eclipse.persistence.example.distributed.Clientthank you
/Michael O'Brien
http://www.eclipselink.org
Similar Messages
-
Java.lang.RuntimeException: Could not find the OffLine WLST class
Installation of OIM On weblogic.
oracle/oim/xellerate/setup/setup.xml:443: The following error occurred while executing this line:
/oracle/oim/xellerate/setup/weblogic-setup.xml:196: java.lang.RuntimeException: Could not find the OffLine WLST class
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Tried to run this command ./wlst.sh
shows
CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:
PATH=/oracle/weblogic/server/server/bin:/home/oracle/bea/modules/org.apache.ant_1.6.5/bin:/oracle/jdk/jre/bin:/oracle/jdk/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/home/oracle/bin:/oracle/jdk/bin
Your environment has been set.
CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar::/oracle/weblogic/server/common/eval/pointbase/lib/pbembedded57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbtools57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbclient57.jar
Initializing WebLogic Scripting Tool (WLST) ...
Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST classtry Problem invoking WLST - Could not find the OffLine WLST class the last post on this thread, he claims to solve the problem...
-
Getting the error " [java] Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class " while building the O2A 2.1.0 PIP. I am using the Design Studio 4.3.2 for building the O2A 2.1.0 PIP. Please let me know how to resolve this issue. Here I am enclosing the log file .
We have basically the same issue when we try to create the interpreter using the embedded method..
I was able to use the interpreter embedded in a java client as long as the weblogic jars were located in a weblogic install if I tried to use them from a maven repository no luck at all...
All of this worked easily in 9.2 now in 10.3 it seems more error prone and less documented.
I have seen close to a 100 posts on issues related to this so is there a document which outlines specifics....
We / I have used weblogic now for almost 10 years and moving from 8.1 to 9.2 was painful and we expected the move from 9.2 to 10.3 not to be soo bad but its proving to be as painful if not more painful than moving to 9.2. We seem to spend a good bit of our time working around issues in the next new release that were not in the previous one..
Any help would be appreciated I think we will open a support case but even that is more painful...
Any help would be greatly appreciated..
PS: We confirmed that all jars in the startweblogic classpath were in the startup. The server we have the embedded wlst instance is a managed server and we are using the component in a war... Are there any restrictions which we are unaware of.
Error we get is
1 [ERROR] com.tfn.autex.order.weblogic.QueueMaintenanceUtility.addQueue():217 Error Adding Queue wowsers JNDI Name wowsers Exception: Invocation Target exception while getting the WLSTOffLineScript path -
Could not find or load main class weblogic.WLST
Hi,
I am trying to run a python script to create JMS components for use with iHub and i got the following error message when i try to run the script:
C:\ihub\bin>java weblogic.WLST omipmihubwlscript.py weblogicjms Welcome1 http://<servername>:7111 OMIPMIHUBServer
Error: Could not find or load main class weblogic.WLST
I have run the setWLSEnv.cmd file and got the following output
C:\oracle\Middleware2\wlserver_10.3\server\bin>setWLSEnv.cmd
CLASSPATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_p
atch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\mod
ules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modu
les\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_man
ifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.
jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.j
ar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp37
1\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSER
V~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\module
s\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;"
PATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDD
LE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\defa
ult\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\module
s\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\
default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bi
n;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\app\paul.currie\product\11.2.0\client_2\bin;C:\app\paul.currie\product\11.2.0\dbhome_3\bin;C:\Program Files (x86)\PC Connectivity Solution\;C:\Wind
ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_13\jre\bin;;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x
64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8"
Your environment has been set.
I am totally stuck at this point so any help would be much appreciated.
Cheers
PaulI have just tested both on a Windows and a Linux server and it works fine.
D:\oracle\product\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd
CLASSPATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\
product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\product\JAVA_C~1\li
b\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\serve
r\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;D:\oracle\product\MI
DDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\pro
duct\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_man
ifest_classpath\weblogic_patch.jar;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\web
logic_patch.jar;D:\oracle\product\JAVA_C~1\lib\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.ja
r;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.ser
ver.modules_10.3.5.0.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\mod
ules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\product\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;
PATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles
\default\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server
\bin;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin
;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\def
ault\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\bin
;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin;C:\
Program Files\Legato\nsr\bin;C:\PROGRA~2\CA\SHARED~1\ETPKI\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C
:\Windows\System32\WindowsPowerShell\v1.0\;D:\oracle\Java\current\jre\bin;C:\PROGRA~2\CA\IDENTI~1\PROVIS~1\BIN;C:\Progra
m Files (x86)\CA\SharedComponents\CAM\bin;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;D:\oracle
\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8
Your environment has been set.
D:\oracle\product\Middleware\wlserver_10.3\server\bin>java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> -
Hi,
I have installed Oracle11g_win64_11gR1, Database and Client.
The issue is unable to invoke "sqldeveloper", getting the following error message. Could you please help ?
FYI. I have already downloaded and installed installed JRE and JDK.
ie. C:\Program Files (x86)\Java\jre6\ and C:\Program Files\Java\jdk1.6.0_24, still did not work.
C:\Users\oracle>java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
Let me know, if you need more information. Here is the error message.
Error Message
=========
(1) if I invoke sqldeveloper, directly from the location " C:\app\oracle\product\11.1.0\db_1\sqldeveloper\sqldeveloper\bin " using explorer, I do get error message
"Unable to find a java Virtual Machine.
To point to a location of java Virtual machine please refer to the Oracle9i JDeveloper Install Guide ( jdev/install.html)"
(2) if I invoke sqldeveloper, directly from the locationC:\app\oracle\product\11.1.0\client_1\sqldeveloper, it prompts me to enter "full path for java.exe".
When I enter full path and continue, still it continue to prompt and ask the same input.
(3) if I invoke sqldeveloper from from command prompt using the batch file "sqldeveloper.bat"
C:\Users\oracle>C:\app\oracle\product\11.1.0\client_1\sqldeveloper\sqldeveloper\
bin\sqldeveloper.bat
C:\Users\oracle>java -Xmx512M -Xverify:none -XX:JavaPriority10_To_OSPriority=10
-XX:JavaPriority9_To_OSPriority=9 -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_F
LAG=true -Dsun.java2d.ddoffscreen=false -Dwindows.shell.font.languages= -Dide.co
nf="sqldeveloper.conf" -Dide.home.dir.name=.sqldeveloper -classpath ..\..\ide\l
ib\ide-boot.jar;..\..\jdev\lib\xmleditor.jar;..\..\ide\lib\oicons.jar;..\..\..\j
dbc\lib\ojdbc5.jar;..\..\jlib\jewt4.jar;..\..\jlib\share.jar;..\..\sqldeveloper\
lib\jle2.jar oracle.ide.boot.Launcher
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/ide/boot/Launc
her
Caused by: java.lang.ClassNotFoundException: oracle.ide.boot.Launcher
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: oracle.ide.boot.Launcher. Program will exit.
OS
==============
MS Windows 7 Home Premium
sqldeveloper.conf
===================
SetSkipJ2SDKCheck true
IncludeConfFile ../../jdev/bin/ide.conf
AddVMOption -Dapple.laf.useScreenMenuBar=true
AddVMOption -Dcom.apple.mrj.application.apple.menu.about.name="SQL_Developer"
AddVMOption -Dcom.apple.mrj.application.growbox.intrudes=false
AddVMOption -Dcom.apple.macos.smallTabs=true
AddVMOption -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG=true
AddJavaLibFile ../../jdev/lib/xmleditor.jar
AddJavaLibFile ../../ide/lib/oicons.jar
AddJavaLibFile ../../jlib/jewt4.jar
AddJavaLibFile ../../jlib/share.jar
AddJavaLibFile ../ide/jlib/xmlef.jar
AddJavaLibFile ../../sqldeveloper/lib/jle2.jar
AddJavaLibFile ../../sqldeveloper/lib/oracle.dbtools.logging.jar
AddVMOption -Dsun.java2d.ddoffscreen=false
AddVMOption -Dwindows.shell.font.languages=
IncludeConfFile sqldeveloper-nondebug.conf
SetJavaHome C:\Program Files\Java\jdk1.6.0_24
Edited by: sivapara on Feb 16, 2011 1:08 PMI was able to resolve this issue by performing following.
1. Go to the location where sqldeveloperW.exe is being executed from.
2. You will find a file sqldeveloper.conf in that location. Edit this file and change the value of IncludeConfFile to point to actual place. For me following were old and new values.
OLD (Wrong) : IncludeConfFile ../../jdev/bin/ide.conf
NEW (Correct) : IncludeConfFile ../../ide/bin/ide.conf
After making above change in the sqldeveloper.conf file. Save and close it. Restart SQLDeveloper. You will not get the error anymore.
Thanks
Ravi -
Execute jar file: "could not find the main class" program will terminate
Hey,
I am new to Java. I have started to make a small java program which supposed to help me at my studies to lean the Dominic Memory System. I have used the latest version of Netbeans 5.5.1 to build my program in. I have two problems which I cannot figure out how to solve, please help me.
The first problem is that the java script I have made works when I compile it in Netbeans, but when I create a Jar file it does not work. I receive a pop up message in windows ?could not find the main class program will terminate? when I execute the jar file.
The second problem I have is that I need to compare the strings generated by the "numbers" and "TIP" and if the numbers is not identical the numbers in the ?Center? JPanel should be highlighted as red.
If anyone would like to clean up the code I would be pleased. I have copied quite a lot from anyone because of my one lack of knowledge.
* GoListener.java
* Created on 12. september 2007, 21:48
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package grandmaster;
import java.awt.event.*;
import javax.swing.*;
import java.util.Vector;
import java.util.StringTokenizer;
import java.awt.Color;
* @author Computer
public class GoListener implements ActionListener {
private JTextField viewer;
private JTextField TIP;
private JTextField freq;
private JTextField max_num;
private Vector numbers;
public GoListener(JTextField j,JTextField k, JTextField m, JTextField f, Vector n) {
freq = f;
max_num = m;
viewer = j;
numbers = n;
TIP = k;
public void actionPerformed(ActionEvent e){
int time = Integer.valueOf(max_num.getText());
int f = Integer.valueOf(freq.getText());
if (e.getActionCommand() == "GO") {
for (int i = 0; i< time;++i) {
int number=0;
number = (int)Math.floor(100*Math.random());
while(number>51){
number = (int)Math.floor(100*Math.random());
if(number<=9){
viewer.setText(" "+"0" + String.valueOf(number) + " ");
} else{
viewer.setText(" " + String.valueOf(number) + " ");
viewer.paintImmediately(viewer.getBounds());
numbers.add(number);
try {
Thread.sleep(f*1000);
} catch (Exception exp) {
viewer.setText(" XX ");
viewer.paintImmediately(viewer.getBounds());
if (e.getActionCommand() == "VIEW") {
try {
//int numb = Integer.valueOf( TIP.getText() ).intValue();
StringTokenizer tokenizer = new StringTokenizer(TIP.getText(), " ");
String[] split = null;
int tokenCount = tokenizer.countTokens();
if (tokenCount > 0) {
split = new String[tokenCount];
for (int current = 0; current < tokenCount; current++) {
split[current] = tokenizer.nextToken();
viewer.setText(" " + String.valueOf(numbers) + " ");
// k=numbers(1);
/*while(c<i){
String.valueOf(k).equals(split[1]);
c++;
TIP.setText(" " + split[2] + " ");
} catch (Exception exp) {
try {
//string testit = numb.toString();
//String str = "" + numb;
//viewer.setText(str);
//viewer.setText(numbers.toString());
numbers.clear();
} catch (Exception exp) {
* Main.java
* Created on 12. september 2007, 21:07
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package grandmaster;
import java.util.Vector;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.JButton;
import java.awt.*;
import grandmaster.GoListener;
* @author Computer
public class Main extends JFrame {
private JTextField viewer;
public JTextField TIP;
// private TextInputPanel TIP;
private Vector numbers;
/** Creates a new instance of Main */
public Main() {
numbers = new Vector();
JPanel p = new JPanel(new GridLayout(0,4));
JButton go = new JButton();
JButton view_num = new JButton();
go.setText("Go!");
go.setVisible(true);
go.setActionCommand("GO");
view_num.setText("VIEW");
view_num.setVisible(true);
view_num.setActionCommand("VIEW");
JTextField max_num = new JTextField();
max_num.setText("5");
JTextField freq = new JTextField();
freq.setText("1");
viewer = new JTextField();
viewer.setText("XX");
TIP = new JTextField("");
p.add(go);
p.add(max_num);
p.add(freq);
p.add(view_num);
getContentPane().add(p,BorderLayout.NORTH);
getContentPane().add(viewer,BorderLayout.CENTER);
getContentPane().add(TIP,BorderLayout.SOUTH);
setSize(200,200);
GoListener g = new GoListener(viewer,TIP,max_num, freq, numbers);
go.addActionListener(g);
view_num.addActionListener(g);
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
Main window = new Main();
window.setVisible(true);
}NetBeans questions should be posted to the NB site. It has mailing lists and associated forums.
This tutorial from the NB site addresses running programs outside of NB
http://www.netbeans.org/kb/articles/javase-deploy.html
When you compare objects, use ".equals()" and reserve == for comparing values. -
Executable JAR file: Could not find the main class.
Hello,
I have a problem with making an executable JAR file.
I have written a JAVA program that consists of five different classes of which User.java is the main class and I have saved a text document with Main-Class: User and a blank line after that.
If I try:
jar cmf MainClass.txt User.jar User.class Beheerder.class Operator.class Manager.class MaakVisueelSchema.class
it makes a executable jar file which actually works! :)
But when the Operator class trys to open the MaakVisueelSchema class the screen stays blank.
I can run MaakVisueelSchema with java MaakVisueelSchema.
So I tried to make an executable JAR that consists only of MaakVisueelSchema, the same way as I did for User:
Main-Class: MaakVisueelSchema
jar cmf MainClass.txt MaakVisueelSchema.jar MaakVisueelSchema.class
Then I get the error message:
Could not find the main class. Program will exit.
from the Java Virtual Machine Launcher.
The big difference between MaakVisueelSchema and the other classes is that MaakVisueelSchema contains a PaintComponent method and an ComponentListener. Is it possible that one of those creates the error?
Can anyone help me with this problem?
Thanks in advance!
Bye!Yes,
I tried:
jar xvf MaakVisueelSchema.jar
and it returns:
META-INF/
META-INF/MANIFEST.MF
MaakVisueelSchema.classN/G. You need to manually create a manifest file in a text editor, have it point to your main class, and enter it in your jar command as an argument. -
Can not start WebLogic in Eclipse. Error: "Could not find the main class."
I have installed Eclipse 2.0 and WebLogic Server 6.1. and the WebLogc plug in from GENUITEC (and jdk1.3.1_04, on Win2K Server). After I have done the configuration, the WebLogic start/stop buttons are integried into the Eclipse Toolbar, but when I click on the start button to start Weblogic, it pops up a dialog box "Java Virtual Machine Launcher" with message: "Could not find the main class. Program will exit!"
Starting WebLogc Server from the Start panel works fine.
Does any one have seen this before or have a suggestion what I should do?
Many many thanks in advance.
HuanWeblogic must be started with a full JDK; otherwise
JSPs and dynamic EJB stubs could not be deployed. The
error message
indicates you are attempting to use a JRE. Configure
Eclipse JRE to point to a JDK. The product
documentation will help you with this process. It does not work for me. :-(
I have tried JDK 1.3.1 and 1.4.1: same result: I get a "Could not find the main class: Program will exit"
For free expert support please consider contacting
Genuitec at [email protected] If just want any
answer ask a newsgroup.
WayneI'll try the support at '[email protected]' :)
Michel
Michel Szybist
[email protected]
Fax: +33 (0)173729897
SMS: http://www.szybist.net/ -
Could not find the main class (with every jar)
This isn't a developer question. I get the error Could not find the main class with every jar I try to open (for example the jar downloaded from https://gjar.dev.java.net/ gives the same problems - and I don't think there is something wrong with that JAR). It isn't a problem with the jar or MANIFEST because the same jar works fine on my laptop. So there is something wrong with my JRE installation, but what?
I tried to remove and reinstall the JRE 6 Update 18 but that didn't work. When I run the JAR with command line java -jar "file.jar" it works fine, but if I dubbelclick on it I get the error message (and it's irritating me).
I'm a bit desperate so I hope that someone here can help me ;)
Thanks in advancedhai T.B.M ... Sorry to post here... I know that i posted my question in wrong thread..but i dont have another solution to contact with you.. I had seen your answers which are really excellent and helped to do my project..
Now i am having very less time to complete my project and i am very new to JMF.. I am not getting output in JMF video capture ..please check the code and guide me where i gone wrong.......please pardon me once again to post here.. Heres my code
import javax.media.*;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import javax.media.protocol.*;
import java.io.*;
import javax.media.control.StreamWriterControl;
public class webcam implements ActionListener,ControllerListener
boolean eomReached = false;
boolean realized = false;
JFrame f;
BorderLayout bd1;
CaptureDeviceInfo device;
MediaLocator m1;
Player player;
Component videoScreen;
JButton b1,b2;
Processor processor;
DataSource ds=null;
DataSink fileWriter=null;
JLabel status=new JLabel("");
public webcam()
try
JFrame f=new JFrame();
JPanel p =new JPanel();
JPanel p1=new JPanel();
device=CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture (Win32):0");
m1=device.getLocator();
System.out.println("1");
processor.configure();
processor = Manager.createProcessor(m1);
processor.setContentDescriptor(new
FileTypeDescriptor(FileTypeDescriptor.MSVIDEO));
ds=processor.getDataOutput();
player.addControllerListener(this);
MediaLocator dest = new MediaLocator("file://foo.avi");
fileWriter = Manager.createDataSink(ds, dest);
fileWriter.open();
ds.connect();
ds.start();
player=Manager.createPlayer(m1);
player.addControllerListener(this);
blockingRealize();
videoScreen=player.getVisualComponent();
b1=new JButton("START");
b2=new JButton("STOP");
bd1=new BorderLayout();
p.setLayout(bd1);
p1.add(b1);
p1.add(b2);
p.add("South",p1);
p.add("East",videoScreen);
f.getContentPane().add(p);
f.setVisible(true);
f.setSize(500,500);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(this);
b2.addActionListener(this);
catch(Exception e){}
public void actionPerformed(ActionEvent e)
if(e.getSource()==b1)
try{
processor.start();
player.start();
fileWriter.start();
catch(Exception e1){}
if(e.getSource()==b2)
try{
player.stop();
processor.stop();
processor.close();
fileWriter.close();
catch(Exception e2){}
public static void main(String args[])
webcam obj=new webcam();
public synchronized void blockingRealize() {
player.realize();
while (!realized) {
try {
wait();
} catch (java.lang.InterruptedException e) {
status.setText("Interrupted while waiting on realize...exiting.");
System.exit(1);
public synchronized void controllerUpdate (ControllerEvent event) {
System.out.println("myPlayer generated "+event.toString());
if (event instanceof RealizeCompleteEvent) {
realized = true;
notify();
} else if (event instanceof EndOfMediaEvent) {
eomReached = true;
} -
sekic0429{uabudd_milou}[w10/rbssw/2.0] pwd
/tmp/MyJava/jexcelapi
sekic0429{uabudd_milou}[w10/rbssw/2.0] printenv CLASSPATH
/tmp/MyJava/excelapi:/app/jdk/1.6.0_16/jre/lib:/app/jdk/1.6.0_16/lib
sekic0429{uabudd_milou}[w10/rbssw/2.0] ls
build ExcelSearch.java index.html resources SearchExcel.java~ tutorial.html
docs ExelSearch.java~ jxl.jar SearchExcel.class src workbook.dtd
ExcelSearch.class formatworkbook.dtd jxlrwtest.xls SearchExcel.java TestSpecification.xls
sekic0429{uabudd_milou}[w10/rbssw/2.0] javac -extdirs . ExcelSearch.java
sekic0429{uabudd_milou}[w10/rbssw/2.0]
sekic0429{uabudd_milou}[w10/rbssw/2.0] java ExcelSearch
Exception in thread "main" java.lang.NoClassDefFoundError: ExcelSearch
Caused by: java.lang.ClassNotFoundException: ExcelSearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: ExcelSearch. Program will exit.
sekic0429{uabudd_milou}[w10/rbssw/2.0] cat ExcelSearch.java
import java.io.File;
import java.io.IOException;
import java.util.Date;
import jxl.*;
import jxl.read.biff.BiffException;
public class ExcelSearch
public static void main(String[] args)
try
Workbook workbook = Workbook.getWorkbook(new File("TestSpecification.xls"));
catch (IOException e)
e.printStackTrace();
catch (BiffException e)
e.printStackTrace();
Regards Peter, hope for answerr035198x wrote:
Where is SearchExcel.class?Excellent question, though I think I spotted a problem with the cp supplied.
Note the documentation for -cp state (in part)
For example, if directory foo contains a.jar and b.JAR, then the class path element foo/* is expanded to a A.jar:b.JAR, except that the order of jar files is unspecified.So instead of this..
java -cp /tmp/MyJava/excelapi:/app/jdk/1.6.0_16/jre/lib:/app/jdk/1.6.0_16/lib SearchExcel..try this..
java -cp /tmp/MyJava/excelapi/*:/app/jdk/1.6.0_16/jre/lib:/app/jdk/1.6.0_16/lib SearchExcelNotes:
1) Adding the JRE classes to the classpath should not be necessary, but I left the rest of the cp unaltered to highlight the one specific difference I am suggesting.
2) When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the indentation and formatting of the sample. To use them, select the sample text and click the CODE button.
If that still fails, tell us more specifically where the SearchExcel class is by copy/pasting the output (within code tags) of the command..
prompt>jar -tvf mysearchexcel.jarWhere, of course, you replace 'mysearchexcel.jar' with the actual Jar name it is supposed to be located in.
Edit 1:
Changed JavaDocs -> documentation.
Edited by: AndrewThompson64 on Jan 11, 2010 7:12 PM -
Could not find the main class : HelloWorldApp program will exit
please help me
i downloaded and installed jdk-6u13-windows-i586-p(1) from sun.java.com
in my computer --> Advanced --> environment variables --> i had set
user variable :
variable value
java_home C:\Program Files\Java\jdk1.6.0_13\bin
System variable:
path : C:\Program Files\Java\jdk1.6.0_13\bin
after that i wrote a program
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
i saved in c:\ mywork
i compiled it with
javac HelloWorldApp.java and then
java HelloWorldApp
output / result also came
but iam unable to create jar file . when it is created it is showing
could not find the main class : HelloWorldApp program will exit
i created jar file by following way
i created
manifest.txt
Min-Class : HelloWorldApp and then
start -->run--> cmd-->
c:\mywork> jar cfm test.jar manifest.txt HelloWorldApp.class
c:\ java -jar test.jar
but it displays a message
" could not find the main class : HelloWorldApp program will exit "
please please please help me please 1000's of please help mePeter__Lawrey wrote:
You have to specify the manifest with a special option (I think its was -M)
Otherwise the jar will create one (even if you provide it)No, the text file passed as a parameter will be incorporated in the manifest file generated by the JAR tool.
@OP: This will work:
JarTest.java
public class JarTest {
public static void main(String[] args) {
System.out.println("JarTest works!");
}manifest.txt
Main-Class: JarTest+(note there is an extra new line in the manifest.txt!)+
Now execute these commands:
javac JarTest.java
jar cfm MyJar.jar manifest.txt JarTest.class
java -jar MyJar.jar And on my machine, the string "JarTest works!" is displayed on the screen.
And if you look in the MANIFEST.MF file inside your jar file (you can use almost any zip-utility for this), you will see the following:
Manifest-Version: 1.0
Created-By: 1.6.0_0 (Sun Microsystems Inc.)
Main-Class: JarTestOr something similar. -
Could not find the main class. Program will exit!
I have created many Executable Jar files before, and this one I did the same. When I run the jar file, (Clicking on it) I get the "Could not find the main class. Program will exit!" error message. When I run the jar file through DOS I get this Stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/ControllerListener
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
Any Ideas? I did a search on google, and looks like others have had this problem but found no answer.
US101There could be several reasons for getting this "Could not find main class" error message. From your stack trace it looks like the class javax/media/ControllerListener is not in your class path. Make sure your manifest file has a line like this:
Class-Path: pathToTheJarFileWithControllerListenerClass.jar otherJars.jar
This error message is also generated whenever any static initialization errors out giving the misleading error message implying that there is something wrong with the main class. Prior to starting your main class, static initialization of any static variables takes place. In my case, I was initializing a resource bundle, and forgot to include the property file in my building of the jar file. Well this failed of course and the generic error message appeared. It took many long hours to figure out it didn't have anything to do with the manifest file or the main class itself.
HTH,
John Bender -
Could not find the main class: projectRFID.ProjectGUI. Program will exit.
Hello,
I'm quite new in Java. I have an application with GUI. When I'm using Eclipse version 3.4.0 to run the application, all it is working perfect.
But after I generate the jar from Eclipse, using the manifest file option from there and added the ProjectGUI to it, where is the main class, and try to run from the command line I receive the next error:
root@slax:~/workspace# java -jar rfid.jar
Exception in thread "main" java.lang.NoClassDefFoundError: projectRFID/ProjectGUI
Caused by: java.lang.ClassNotFoundException: projectRFID.ProjectGUI
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: projectRFID.ProjectGUI. Program will exit.
root@slax:~/workspace#
I run this application on a SLAX system with jdk6 update 7.
I tried to generate the jar file even from the command line using the manifest file option but I still receive the same error.
I hope somebody can help me!
Thank you!cojogrizli wrote:
The structure of my project in Eclipse is src/project/files.java and in jar file is src/files.java bin/class.java Dati/ and META-INF/.That's wrong. You don't need the .java files in the jar (but you can have them, if you want, they are just not used by Java).
And each .class file must be in a directory that reflects its package. So in your example ProjectGUI.class must be in the directory projectRFID/ inside the .jar file. -
Could not find the main class ! exception.
hi,
I create one java project. for this I am using netbeans 5.
I try to run the project jar file stff.jar. When run using "java -jar stff.jar " , it throws error "could not find the main class. program will exit".
I am extracting this jar file, in manifest, main class is set.
i.e, in manifest, Main-Class: ems.emsFrame.
ems is my folder ,inside it main class kept.
here, emsFrame is my main class where " public static void main (String args[])" is located.
I am also, set the class path for that class folder(ems) and run.
The same error ("could not find the main class. program will exit") occured.
Why this error occured.
also,I am uninstall the jdk and reinstall .
whats my problem.
byeyes sir.
In projects, inside it, in Libraries ,the SNMPInquisitor.jar is located.
inside that jar, snmp package is located.
but, when build and run, there is no problem sir.
Only when i try to run the stff.jar file (java -jar stff.jar), that time only the exception thrown.
when I double click that jar, it show, "could not find the main class. program will exit". But, I am adding the main class in manifest. when i open manifest.mf, it show, Main-Class: ems.emsFrame.
but, when i run jar thro' cmd window, it shows,
Exception in thread "main" java.lang.NoClassDefFoundError: snmp/SNMPGetException
at ems.emsFrame.<init>(emsFrame.java:1163)
at ems.emsFrame.<clinit>(emsFrame.java:1155).
i am still trying it. -
Could not find the main class in Eclipse
Hey,
I've been working with Java for a few years now, but I recently set-up a new Eclipse-environment and now my Application won't run...
"Could not find the main class. Program will exit."
If I compile and run the source myself it works fine, so it must be a setting in Eclipse somewhere...
It doesn't work, even when I put the class in the default package...
It must be something very stupid, but I can't seem to find out what the problem is :(It was only the basic Hello-World-concept;
public class Game extends JFrame {
/** A default SerialVersionUID */
private static final long serialVersionUID = 1L;
public Game() {
addKeyListener(new GameController());
MainView view = new MainView(...);
add(view);
* @param args The game-options
public static void main(String[] args) {
Game spel = new Game();
spel.setSize(1024, 768);
spel.setTitle("Java Rally");
spel.setResizable(false);
spel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
spel.setVisible(true);
}
Maybe you are looking for
-
Can I sync my IPOD Touch on my PC after my Laptop HDD crashed?
Laptop hard drive had a physical crash. My Itunes library was on laptop. I have authorized the laptop and the PC but I want to be able to sync the songs I have on my device to ITunes on the PC. This doesn't seem to be possible? Is there any way? I ha
-
10 points to the first whiteknight who can fix this simple problem
Hello team, I'm working with this excellent Flash grid gallery for my current project, however, I've reached a snag. Instead of using a hex as the image background (currently set to #FFFFFF in the .xml), i'd like to use a moving gif, to give the tran
-
How to load internet explorer to Os10.5.8
Hi A couple of websites need internet explorer = I thought I had it as part of OS10 but it is not now there. Cana anyone please advise me how to best install it Many thanks Pam
-
PO: service tax , VAT applicable
Dear All, in a PO, i need to calculate total price. Base price service tax 12.36% on base price subtoatl1 = base price+ servce tax of 12.36% VAT- 3% on subtotal1. how to map in SAP please let me know
-
Installing older software,Illustrator CS3 and Indesign CS5, on new laptop
I've had to abandon my desktop as it was beyond repair and have tried to install Illustrator CS3 and Indesign CS5 (cds) on my laptop. I get a message saying that there was a problem with licensing. I own the software and can't find anyone to speak to