JAR creation JBuilder
I'm trying to create a .jar file with this manifext file:
Manifest-Version: 1.0
Name: classes\Testing.class
Main-Class: classes.Testing
(JBuilder created the manifest file but I added the Name: Line)
The problem is no matter what I try for Main-Class whenever I run the program I get a "main class could not be found" error. The Testing.java is in a folder called "src" and the Testing.class is in a folder called "classes".
Please help I've been trying to do this for hours now!
P.S. And yes theres a carriage return after main-class
Which it probably isn't unless a package is a folder which I doubt. You doubt? Is it in a package/folder or isn't it? Does your Testing.java file have "package XXX;" as its first line? If so, it should be in package XXX. If not, it's in the default package, and the class name is "Testing".
so then what would I put there just "Testing"?This is Java 101. Better go read about packages and how to compile classes that have them.
The class name should be "Testing.class". If it has a main(), then Main-Class should be "Testing".
%
Similar Messages
-
Jar creation from JBuilder file structure
Hi,
I've got a program written in jBuilder 4. It does not have the jar creation feature.
So I've created a jar manually, but I'm having problems finding the main class from the manifest.
I've created the manifest with no problems:
Manifest-Version: 1.0
Main-Class: Application1
Created-By: me
Where Application1 is the name of my main class. I've even tried chnging the file path to Application1 such as:
Main-Class: programfile/classes/programname/Application1
But whenever I create the jar and double click on it I get an error saying that cannot find main class.
Does anybody know how to access the main class from a program created in JBuilder???
Cheers for any help,
AlCheers for the suggestion, but I managed to sort the problem.
For anyone else out there who's trying to jar a JBuilder file manually:
You only need to jar the "class" folder that JBuilder creates for you, not ther entire project. (If you have a file containing images then that will need to be included as well).
If you've not named your main class the same as the pakage name, then the mane of your main class is packagename.main
For example if your package is called "Program" and your main class is called "Main" then you need to include the following line in the manifest:
Main-Class: Program.Main
Hopes this helps someone.
Al -
Weblogic jar creation in Jbuilder 8
Hi,
I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogic as the
application server, but there is one service (Jar Creation) which is never enabled.
Why? Isn't it possible to create JAR files for weblogic as I did in Jbuilder 6?
Should I use any weblogic specific tool for doing so?
The JAR files I create with Jbuilder8 don't contain the stub and skeleton classes
I need!!!! In Jbuilder6 it was not necessary to specify a server application for
every service, just one for all, and it worked fine, generating everything I needed
in my JAR.
Help!!!!Is there any bea newsgroup for JBuilder, as far as there's a JBuilder Weblogic
Edition version launched or should I try in Borland's newgroups?
"Slava Imeshev" <[email protected]> wrote:
Hi Ignacio,
I suggest contacting Borland support or posting this question in the
related
jbuilder newsgroup.
Regards,
Slava Imeshev
"Ignacio" <[email protected]> wrote in message
news:[email protected]..
Hi,
I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogicas the
application server, but there is one service (Jar Creation) which isnever
enabled.
Why? Isn't it possible to create JAR files for weblogic as I did inJbuilder 6?
Should I use any weblogic specific tool for doing so?
The JAR files I create with Jbuilder8 don't contain the stub and skeletonclasses
I need!!!! In Jbuilder6 it was not necessary to specify a serverapplication for
every service, just one for all, and it worked fine, generating everythingI needed
in my JAR.
Help!!!! -
JAR creation failed , for Command bean DC
Hi Experts,
I am trying to access an EJB module DC from WebDynpro through Java bean model DC.
In this when i tried to create a Jar file of the Java bean model, i got this error.
JAR creation failed. See details for additional information.
Problem writing /LocalDevelopmentdc_aptcbsap.com/bin/pg/com/atos/apt/bean/APTCommandBean.class to JAR: duplicate entry: pg/com/atos/apt/bean/APTCommandBean.class
I have created in all total 4 DC
1) EJB DC
2) EAR DC
3) Java bean DC
4) WebDynpro DC
I have reffered to the tutorial : Using EJBs in Web Dynpro application.
Can you tell me what am i missing?
Ashish ShahHi Sridhar,
Thanks for your suggestion.
I have built and deployed the EAR DC.
But When I added the following referencesto Java bean DC
1) EAR DC , EJB DC
2) ejb20.jar
and i tried to build java bean DC project, it throws error for these referenced DC.
And these referenced DCs are removed from the project.
Do i have to add anything in the Public part of EJB or EAR DC?
Can you tell me how to add those references in Public part and how to utilise them in other projects?
Regards,
Ashish Shah -
JAR creation failed. See details for additional information.-invalid header
Hi
I am working with 2 databases , 1 is oracle and the other is sybase in my java application.
The java application gets data from both the databases and creates 3 output files and 1 audit log file .
Now i tried creating the jar file
my manifest file looks like this :
Manifest-Version: 1.0
Sealed: true
Main-Class: tableA
Class-Path:jtds-1.2.jar;classes12.jar ----------------------------> is this correct .
Now when i try to create the jar file it gives me an err
JAR creation failed. See details for additional information.-
invalid header field
invalid header field
ANyone pls help me ... I am creating the jar file like rhis
export -> selecting JAR file -> selecting 1 and 3 rd checkboxes ->location of the jar file -> next->selecting 2 checkboxes in JAR PACKAGING OPTIONS -> ( my question is how to create the manifest file with class-path , their is no option ) so i am creating the manifest file and creating the jar file and then adding the class-path to the manifest file and removing the jar file and recreating the jar file now selecting the manifest file .
is this giving the above error --> if so how to create the manifest file before creating the jar file with class-path and main classDouble post: [http://forums.sun.com/thread.jspa?threadID=5358017&messageID=10559776#10559776]
-
How to disable application jar creation in tmp folder
Hi
I am deploying an application on clustered server.
Everytime i deploy application a jar(for the application) is getting created in admin server's tmp folder in the folder WLTEMP_APP_DOWNLOADS/<application_name>/<application_name.jar>
I am deploying application in exploded format and one of its functionality is to generate csv files.
As Weblogic seems to be referring the application_name.jar I get a 404 error whenever csv files are accessed in UI.
Could somebody please suggest the settings to disable the application jar creation.The issue was with weblogic caching.
The server was creating a jar of the application in a tmp folder for every deployment .
Due to this any new file generated within deployment path was not being identified.
Disabling caching on admin server resolved the issue. -
I am trying to create a JAR file with the java.util.jar library/package.
I am able to create the file and get files into it but I am unable to access it from a java program.
If i create the same jar file with the commandline utility i can access it just fine from within a java app. The two jars are identical in their content and structure however they differ in overall size of about 5-10K. Is there something special i need to do to make this jar useable by java? is the API in adequate for this kind of thing? are there any alternatives?
-ChazZthe code for JAR creation:
"files" is an arraylist i build that consists of paths to the files i wish to put in the jar
FileInputStream fi = new FileInputStream("." + PATH_SEPARATOR + "MANIFEST.MF");
Manifest m = new Manifest(fi);
BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream(jarFile));
JarOutputStream jo = new JarOutputStream(bo, m);
Object[] f = files.toArray();
for(int x=0; x<f.length; x++)
String act = (String)f[x];
BufferedInputStream bi = new BufferedInputStream(new FileInputStream(act));
//file paths are too deep in filesys to i strip off the first part of the path
JarEntry je = new JarEntry(act.substring(act.lastIndexOf("psdi")));
jo.putNextEntry(je);
byte[] buf = new byte[1024];
int anz = -1;
while ((anz = bi.read(buf)) != -1)
jo.write(buf, 0, anz);
jo.flush();
jo.closeEntry();
bi.close();
jo.close();
bo.close();
} -
hi all,
when i export java project as jar file i got a message[i] jar creation failed
it's because of duplicate entry: .classpath
how can i avoid this problem
Thanks alotWe're going to need more information to offer any realistic help. Duplicate class path entry where?
Walk us through your process. For doing build functionality of just about any kind I would recommend learning to use ANT. It will make your life much happier.
PS. -
JAR creation failed in Eclipse. error in opening zip file
When Exporting the project to Runnable JAR file in Eclipse, I have "JAR creation failed", with "error in opening zip file" in details and nothing else.
I've tried running the new Eclipse environment by starting a new .metadata file. Then, I rebuilt the project - it runs as before.
What zip file is referred to?I imagine it's the "Export destniation" jar/zip. Perhaps it's being
used by a running application and is therefore locked against writing.
Have you tried deleting it from the command line?
[email protected] wrote:
> When Exporting the project to Runnable JAR file in Eclipse, I have
> "JAR creation failed", with "error in opening zip file" in details and
> nothing else.
>
> I've tried running the new Eclipse environment by starting a new
> .metadata file. Then, I rebuilt the project - it runs as before.
>
> What zip file is referred to? -
Deleting JAR Creation on JBuilder
I used the Archive Wizard on JBuilder to create some archives that are created during building. But now I want to stop one from being created, how do I do it??? JBuilder doesn't seem to offer any way of keeping track of archives after you set one up.
Never mind, had that lefttop menu sized down, inadvertantly looked there and saw em listed next to the classes
-
Classes.jar creation failure in atglib - EAR creation
Hi All,
classes.jar (CUSTOMERShop.is-customer) file is not getting generated for custom created module even after importing the classes successfully during ear assembling.
Please find below the logs for the same. Kindly help to resolve this issue.
[mvn] [INFO] Assembly started.
[mvn] [INFO] Target application is C:\projects\CUSTOMER\EARs\CUSTOMERShop.ear.
[mvn] [INFO] Creating exploded ear file C:\projects\CUSTOMER\EARs\CUSTOMERShop.ear.
[mvn] [INFO] Initializing...
[mvn] [INFO] Updating C:\projects\CUSTOMER\EARs\CUSTOMERShop.ear.
[mvn] [INFO] Before make meta-inf file.
[mvn] [INFO] Making meta-inf file C:\projects\CUSTOMER\EARs\CUSTOMERShop.ear\META-INF
[mvn] [INFO] Creating application.xml...
[mvn] [INFO] Creating Ear file MANIFEST...
[mvn] [INFO] Importing classes...
[mvn] [INFO] Importing classes for module DafEar
[mvn] [INFO] Importing classes for module DafEar.Admin
[mvn] [INFO] Importing classes for module DafEar.base
[mvn] [INFO] Importing classes for module CUSTOMERShop.is-customer
[mvn] [INFO] Importing classes for module CUSTOMERShop.Shop
[mvn] [INFO] Importing classes for module CUSTOMERShop.commerce-customer.commerce-non-versioned-customer
[mvn] [INFO] Importing classes for module CUSTOMERShop.commerce-customer
[mvn] [INFO] Importing classes for module CUSTOMERShop.commerce.commerce-non-versioned
[mvn] [INFO] Importing classes for module CUSTOMERShop.commerce
[mvn] [INFO] Importing classes for module CUSTOMERShop.common
[mvn] [INFO] Importing classes for module CUSTOMERShop.common-generated
[mvn] [INFO] Importing classes for module B2CCommerce
[mvn] [INFO] Importing classes for module DCS.AbandonedOrderServices
[mvn] [INFO] Importing classes for module DCS.PublishingAgent
[mvn] [INFO] Importing classes for module DCS
[mvn] [INFO] Importing classes for module PublishingAgent
[mvn] [INFO] Importing classes for module PublishingAgent.base
[mvn] [INFO] Importing classes for module REST
[mvn] [INFO] Importing classes for module DSS
[mvn] [INFO] Importing classes for module DPS
[mvn] [INFO] Importing classes for module DAS-UI
[mvn] [INFO] Importing classes for module DAF.DeploymentAgent
[mvn] [INFO] Importing classes for module DAS
[mvn] [INFO] Ignoring classpath entry lib/servlet.jar from module DAS
[mvn] [INFO] Ignoring classpath entry lib/jsp-api.jar from module DAS
[mvn] [INFO] Importing classes for module CUSTOMERShop.environment.commerce-development
[mvn] [INFO] Importing classes for module CUSTOMERShop.environment.licences.dev
[mvn] [INFO] Importing classes for module CUSTOMERShop.environment.data
[mvn] [INFO] Importing classes for module CUSTOMERShop.libext
Regards,
DKAPThe logs do not show any errors or info related to that.
How are you generating the classes.jar for custom module?
Ear creation or runAssembler will not generate classes.jar. Do you have plugin to compile and create the jar file from the source folder?
Do you find the classes.jar in the ATG-ClassPath location mentioned in the MANIFEST.MF file?
Peace
Shaik -
Hi
i have a question for you.
I create a jar of my application in jbuilder 2007 and when i execute with
java -jar test.jar it's work fine.
After i try to create an executable jar but when i execute it i have a problem.
In a class i have error (java.lang.unsupportedclassversionerror..... major.minor version 49)
i think that jbuilder create my executable file using jre 1.4 and does'nt use my jvm version 5.
can you help me?Hi
i have a question for you.
I create a jar of my application in jbuilder 2007 and
when i execute with
java -jar test.jar it's work fine.
After i try to create an executable jar but when i
execute it i have a problem.
In a class i have error
(java.lang.unsupportedclassversionerror.....
major.minor version 49)
i think that jbuilder create my executable file using
jre 1.4 and does'nt use my jvm version 5.
can you help me?No, that means that you are trying to execute the application using a JRE that is too old. E.g. trying to execute with 1.4 but your classes requires 1.5.
See what java -version gives
Kaj -
Missing something on JAR creation.
This must be a simple error I'm commiting but it has me stuck on the distribution of my application.
Even though my app works perfectly on prompt I don't seem to be getting the right works for making the jar file for it.
My class files are distributed like this :
Salfoot
Salfoot/Interface
Salfoot/Classes
in the root dir there is only the entry point program that then calls a start frame , etc...
the following code is contained in this file
prmSalfoot.java
import javax.swing.*;
import Salfoot.Interface.frmLogin;
public class prmSalfoot
frmLogin login;
public static void main(String[] args)
JFrame login = new frmLogin();
login.show();
The manifest file is as follows :
Manifest-Version: 1.0
Main-Class: prmSalfoot
The jar file is generated with the following command :
jar cmfv manifest salfoot.jar prmSalfoot.class Interface/*.class Classes/*.class
The following command is how I'm executing the jar file :
java -jar salfoot.jar
And the following error is what is outputted :
Exception in thread "main" java.lang.NoClassDefFoundError: Salfoot/Interface/frmLogin
What I think is... that the entry-point program is found... but the classes in the packages used are not.
What special treatment do I need to do with the packages? Is it in the manifest file that I need to make changes? Or should I make separate JAR files for each of the packages and then make a main JAR including the package JARs?
Thanks for any enlightment.
Y.S.From my understanding you don't need to have all the
packages in the one jar file.
The VM builds the class path from the Class-Path attribute
specified in the manifest file. to specify files outside
the main jar file set the Class-Path as follows.
Class-Path: g:\server\Server.jar ..\server\Server2.jar
this will access classes in the these jar files.
One thing that I've found with this is that if the
classes in these external jar files are in packages
then a class not found error is thrown but if they are
just classes not in packages this works find. I'm still
doing some experimenting with this as I've only started
using jar files.
Any thoughts????? -
EJB Client JAR Creation - Workspace Studio (ALSB 3.0/WLS 10)
hi
I'm trying to create an EJB Client JAR for an 2.1 Session Bean EJB Created in a WLS 10 domain using BEA Workspace Studio (i.e. this is the Aqualogic Service Bus 3.0 Product install).
I'm doing this in preparation for testing the ALSB EJB Transport which requires a client JAR.
I simply can't get a useful JAR from the facility provided in the Workspace IDE. The Workspace help is pointing to an IBM generated page and I'm following the procedure there.
I have configured the EJB for an EJB Client Project.
If I export an EAR from the Application containing the EJB, the EAR only contains the EJB JAR (with a Manifest entry to a non-existent Client JAR).
If I export the EJB Client Project to a JAR the JAR is simply empty i.e. contains some descriptor type artefacts but no classes.
I have tried this quite a few times with the same outcome. Can anyone from BEA or the user community confirm whether or not this facility actually works!
Thanks
Jim Nicolsonhttp://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/ejbTransport/ejbtransport.html#wp1079062 . This is document for OSB 10xx and yours is a a version or two older than this (So it will be applicable).
Can you please check if your EJB are complying to 2.1specification?
However the latest version of service has support for both EJB 2.1 and EJB 3.0 specification
http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15866/ejb.htm#CCGIFFCI
Thanks
Manoj -
Help on JAR creation (newbie)
Hi guys so I am using Eclipse 3.2 and I click on the project and I say Export to Java --> JAR file
then I go to prompt and I do java -jar blah.jar and that gives me an error:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driver/Or
acleDriver
at Driver.main(Driver.java:81)I know why I am getting this. Because I am using the JDBC in my code and there's another jar file that does that its actually called: ojdbc14.jar
So the question is what do I do. I just want to run this project without having to run Eclipse. If there's any other way I can run this project besides JAR and Eclipse, oh and just typing java Driver doesn't work either so.
Any help would be appreciated.Simplest would be use of java with the -cp option. something like java -cp blah.jar;jdbc.jar MainClassOtherwise, you should be able to use the Class-Path attribute of the manifest to specify a relative path to the jdbc jar.
Maybe you are looking for
-
EXCEPTION_ACCESS_VIOLATION in Web Start
Hi, I am using JDK 1.5. And there is an EXCEPTION_ACCESS_VIOLATION when I tried to launch a program via Web Start. The program just crash after I press some items. Do you have any idea ? # An unexpected error has been detected by HotSpot Virtual Mach
-
What on earth is the deal with my MBP?
My MacBook Pro has been showing weird and kind of major problems ever since I exchanged the internal Hitachi hard drive for an OWC Mercury Extreme Pro 6G. Sometimes, not too often, when I boot it doesn't detect the SSD. I get either a screen like thi
-
Help to create a SCOM Alert for same event ID on many Windows 2008 servers
Hi all, I 'm a newbie in SCOM and I need to create a alert with information type on 1 event ID on 2 servers. The Event ID is the same on both servers and I don't know which type of monitor I need to create. Can you help me please ? Thanks a lot.
-
Let me just go ahead and say that; iOS8 is the worst update I have ever experienced on an iOS device. I have been a diehard Apple fan since my 3GS - this is THE WORST. Here is my problem: On iOS' 4.??? through iOS 7.1.2, my iPad has been set up with
-
I am looking for ways to setup signing limits for employees(approvers) in iExpenses. I am aware of the signing limits form but it requires data to be entered for every manager. Is this the only way to do it ? any other suggestions where we can use si