Cant get JAR file to execute

I'm developing an application in using JDK 1.2.1 and Borland/Inprise's JBuilder Professional version 3.0 (the OS is MS windows 98).
My program is an application , not an applet.
My program runs OK from the jbuilder development environment, but now I want it standalone , as a .JAR file. Using jbuilders deployment wizard, I've created a .JAR file for my program ("untitled2.jar).
It includes a manifest.
I set up a test subdirectory c:\test and copied all the files from c:\program files\javasoft\jre\1.2\bin (which includes java.exe and javaw.exe). I then copied untitled2.jar to c:\test
I've looked in books & searched on the web site and I've tried various permutations of the syntax. For example I tried :
java -jar -cp c:\test untitled2.jar
but get the error message:
"Failed to load Main-Class manifest attribute from untitled2.jar"
Have I just got the syntax wrong or am I missing something else?
Also do I understand right that JRE.EXE has been replaced with JAVA.EXE (and JREW.EXE with JAVAW.EXE) ?
thanks in advance for any help
Mike

Thanks for the replies. I tried what you said :
I've replaced "untitled2.jar" with "loofabtest.jar" (actual name of the program)
The program is 2 java source files (loofabtest.java and frame1.java) , the main file is contained in
public class loofabtest within in loofabtest.java. The JAR file created is called loofabtest.jar
As I said previously the program runs OK from within jbuilder. All files & class names are lower case.
I used winzip (version 7.0) to open loofabtest.jar.
When I open loofabtest.jar there is a file called Manifest.mf with a path:
meta-inf\
when I open that there is NO line
Main-Class: my.main or similar
So I edit the Manifest.mf file & added a line :
Main-Class: loofabtest
Query 1: is this syntax right or should the line read: Main-Class: loofabtest.class
after editing the file , when I save it I get an overwrite option , if I say no , I end up with 2 manifest files (which I think wont work) If I yes to overwrite , the file loses the
meta-inf\     
path (i.e. there is no path)
I tried editing the manifest in jbuilder , but with no luck (jbuilder autogenerates the manifest)
I also tried extracting all the files in the JAR , editing the manifest , then rearchiving them. I get the error message
java.io.IOException: invalid manifest format
at java.util.jar.Manifest.read(Compiled Code)
at java.util.jar.Manifest.<init>(Manifest.java:55)
at sun.tools.jar.Main.run(Main.java:87)
at sun.tools.jar.Main.main(Main.java:760)
Query 2 : Is there an easy way to edit the manifest file to add the line needed and keep the meta-inf\ path?

Similar Messages

  • Scheduling Jar files to execute

    Hey Everyone!
    Help Please!
    Im needing to schedule one of my jar files to execute late at night,when no one is around! The jar file works perfectly, but when scheduled does not run,I have tried using various schedulers and none of them execute the jar file at the scheduled time, it doesnt even start up the JRE,it just gives an error msg that it could not start!I have tried with various jar files and various schedulers!
    I dont want to use Java's timer, I want to be able to schedule it using something like win98 scheduler!So that my clients can schedule it for anytime they want to,at that level of ease!And I dont want a thread running in the background 24-7!
    Is this a bug in java,or am i missing out on something here???
    Thanks guys!
    Justin

    I schedule all my java *.jar program through a batch file. For example, if you have a program HelloWorld.jar in c:\test directory. I would create a HelloWorld.bat file such as:
    c:
    cd c:\test
    java -jar HelloWorld.jar
    exit
    Then, I will schedule my HelloWorld.bat to run at anytime I like.
    This works for me on all my scheduled java progarms.

  • Jar file not executing on double-click

    Hello,
    I have a .jar file that I would really like to execute using a double-click in win xp.
    I can execute the jar file witha java -jar command on the command prompt and the program runs but when double-clicking i get the error: cannot find the main class: program will exit
    I had win rar installed on my computer which changed itself to the default app to open jar files.
    So this is what I've tried
    I tried modifying the registry command to run java -jar, javaw -jar but they don't work.
    I have created several manifest.mf files with this in them
    Manifest-Version: 1.0
    Created-By: 1.4.2_07 (Sun Microsystems Inc.)
    Main-Class: MyClass
    I know that a carraige return needs to be at the end though I don't know really how to check for it (I assume its there because I have a few extra lines after the last text peice). I've read through some other threads but nothing seems to work. It's getting really annoying always having to go through the runline. Thanks for the help.

    I don't understand why Netbeans has such a hard time creating working jar's for applications. This is the second time I've written an application that just will not work when trying to execute using the jar. The last time this happened I used Eclipse and imported everything (including the layout) and Eclipse got it working the first time.
    This time, I thought I'd go back to Netbeans since they released a newer version 4.0 (I haven't gone to 4.1 yet). Apparently nothing has changed as my application, once again will not run from the jar. What's the deal with Netbeans?
    I think I'll, once again bring my project into Eclipse and have that make the jar.
    Kurt

  • Help needed: getting jar files to work.

    Right, to start off, i have been doing php and mysql for a long time and i thought it's time to start using java.
    So now im trying to create an application. I use eclipse. All works well if i run the program from eclipse. But i want to create and executable or a jar file first. I used JSmooth but with that i get an error "Could not find the main class".
    While exporting the project as a jar i specified the main class in manifest specification.
    So these are my classes:
    the Main.class
    public class Main{
         public static void main(String[] args)  {
              PageFrame page = new PageFrame();
              page.show();
    }and the PageFrame.class
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    class PageFrame extends JFrame implements ActionListener,MouseListener{
         String[] skillnames = {"attack","hitpoints","mining","strength","agility","smithing","defence","herblore","fishing","ranged","thieving","cooking",
                   "prayer","crafting","firemaking","magic","fletching","woodcutting","runecraft","slayer","farming","construction","hunter","summoning"};
         JTextField username = new JTextField("",12);
         JTextArea box = new JTextArea(10,12);
         JButton search = new JButton("Search");
         int[] differences = {0,83,174,276,388,512,650,801,969,1154,1358,1584,1833,2107,2411,2746,3115,3523,3973,4470,5018,5624,6291,7028,7824,
                   8740,9730,10824,12031,13363,14833,16456,18247,20224,22406,24815,27473,30408,33648,37224,41171,45529,50339,55649,61512,67983,
                   75127,83014,91721,101333,111945,122660,136594,150872,166636,184040,203254,224466,247886,273742,302288,333804,368599,407015,
                   449428,496254,547953,605032,668051,737627,814445,899257,992895,1096278,1210421,1336443,1475581,1629200,1798808,1986068,2192818,
                   2421087,2673114,2951373,3258594,3597792,3972294,4385776,4842295,5346332,5902831,6517253,7195629,7944614,8771558,9684577,10692629,
                   11805606,13034431,14567891};
         URL page;
         static String name;
         JLabel[] skills  = new JLabel[24];
         JLabel skillicons  = new JLabel();
         public PageFrame(){
              super("Stats Lookup");
              setSize(800,600);
              setResizable(false);
              try{
                   UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                   SwingUtilities.updateComponentTreeUI(this);
              }catch (Exception e){
                   System.err.println("Yo" + e);
              //teen labelid;
              for (int i = 0; i < skills.length;i++){
                   ImageIcon icon = new ImageIcon(PageFrame.class.getResource("images/skillimages/" + skillnames[i] + ".gif"));
                   skills[i] = new JLabel("00",icon,JLabel.CENTER);
              JPanel pane = new JPanel();
              GridBagLayout maingrid = new GridBagLayout();
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              GridBagConstraints constraints = new GridBagConstraints();
              JPanel skillPane = new JPanel();
              GridBagLayout levelslyo = new GridBagLayout();
              GridBagConstraints sConstraints = new GridBagConstraints();
              sConstraints.ipadx = 15;
              sConstraints.ipady = 10;
              skillPane.setLayout(levelslyo);
              int k = 0;
              int m = 1;
              buildconstraints(sConstraints,12,4,1,1,2,2);
              skillPane.add(skillicons);
              for (int i = 0; i < skills.length;i++){
                   buildconstraints(sConstraints,m,k,1,1,2,2);     
                        levelslyo.setConstraints(skills, sConstraints);
                        //skills[i].setText(" 0 ");
                        skillPane.add(skills[i]);
                        skills[i].addMouseListener(this);
                        m+=2;                    
                        if (m == 7){
                             m = 1;
                             k +=1;
              /*m = 0;
              k = 0;
              for (int i = 0; i < skills.length;i++){          
                   System.out.println("Paremale: " + m + " Alla: " + k);
                   buildconstraints(sConstraints,m,k,1,1,2,2);     
                   levelslyo.setConstraints(skillicons, sConstraints);
                   skillicons = new JLabel(icon);
                   skillPane.add(skillicons);
                        m+=2;                    
                        if (m == 6){
                             m = 0;
                             k +=1;
              buildconstraints(constraints,0,0,1,1,100,100);
              maingrid.setConstraints(username, constraints);
              buildconstraints(constraints,1,0,1,1,100,100);
              maingrid.setConstraints(search, constraints);
              buildconstraints(constraints,0,1,1,1,100,100);
              maingrid.setConstraints(skillPane, constraints);
              pane.setLayout(maingrid);
              constraints.fill = GridBagConstraints.BOTH;          
              search.addActionListener(this);
              box.setEditable(false);
              buildconstraints(constraints,1,1,2,1,120,100);
              maingrid.setConstraints(box, constraints);
              pane.add(username);
              pane.add(search);
              pane.add(box);
              pane.add(skillPane);
              setContentPane(pane);
              //getContentPane().add(scroll);
              pack();
              setVisible(true);
              WindowListener l = new WindowAdapter(){
                   public void windowClosing(WindowEvent evt){
                        System.exit(0);
              addWindowListener(l);
         void buildconstraints(GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx,int wy){
              gbc.gridx = gx;
              gbc.gridy = gy;
              gbc.gridwidth = gw;
              gbc.gridheight = gh;
              gbc.weightx = wx;
              gbc.weighty = wy;
         /*Vector ranks = new Vector();
         Vector levels = new Vector();
         Vector exp = new Vector();*/
         class Stats{
              int[] levels = new int[34];
              int[] experience = new int[34];
              int[] ranks = new int[34];
         Stats stats = new Stats();
         public void getStats(URL url){          
              URLConnection conn = null;
              InputStreamReader in;
              BufferedReader data;
              String line;          
              StringBuffer buf = new StringBuffer();
              try{
                   conn = this.page.openConnection();
                   conn.connect();
                   //box.setText("Connection opened");
                   in = new InputStreamReader(conn.getInputStream());
                   data = new BufferedReader(in);
                   //box.setText("Reading data...");
                   int ts=0;
                   while ((line = data.readLine()) != null){
                        buf.append(line + "\n");
                        StringTokenizer tokenize;
                        tokenize = new StringTokenizer(line.toString(),",");
                        int[][] paarid = {{1,0},{2,3},{3,6},{4,1},{5,9},{6,12},{7,15},{8,11},{9,17},{10,16},{11,8},{12,14},{13,13},
                                  {14,5},{15,2},{16,7},{17,4},{17,10},{19,19},{20,20},{21,18},{22,22},{23,21},{24,23}};
                        if (ts < 25 && ts > 0){
                             int slot = paarid[ts-1][1];
                                  stats.ranks[slot] = Integer.parseInt(tokenize.nextToken());
                                  int yo = Integer.parseInt(tokenize.nextToken());
                                  stats.levels[slot] =yo;
                                  stats.experience[slot] = Integer.parseInt(tokenize.nextToken());                         
                        ts++;
                   for (int i = 0; i < skills.length;i++){
                        String text = ""+stats.levels[i];//testings[i];//
                        skills[i].setText(text);
              }catch(IOException e){
                   box.setText("Insert a username \nfirst!");
         public String getNextXp(int level, int currxp){
              String nextXp;
              if (level > 98){
                   nextXp = "N/A";
              }else{
                   nextXp = ""+(differences[level] - currxp);
              return nextXp;
         public void actionPerformed(ActionEvent evt){
                   String newuser = username.getText().toString();
                   name = newuser;
                   String address = "http://hiscore.runescape.com/index_lite.ws?player="+name;
                   try{
                        page = new URL(address);               
                        getStats(page);
                   }catch(MalformedURLException e){
                        box.setText("Insert a username");
                   repaint();
         public void mouseEntered(MouseEvent e) {
              //if (experience[].isEmpty()){          
                   Object s = e.getSource();
                   for (int i = 0; i < skills.length;i++){
                        if (s == skills[i]){
                             box.setText("Rank: " + stats.ranks[i] + "\nExperience: " + stats.experience[i] + "\nExp until next: " + getNextXp(stats.levels[i],stats.experience[i]));
         public void mouseExited(MouseEvent e) {
    box.setText("");
         public void mouseClicked(MouseEvent e) {
         public void mousePressed(MouseEvent e) {
         public void mouseReleased(MouseEvent e) {
    This is just a little project i thought i'd make for learning.
    But can anyone help me make a working jar or an exe file?
    The Jar i created does nothing, no error or anything.
    Thanks for Help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    How should i run the jar file then? I am double clicking it yes.
    EDIT: i ran the program through command line and i got an error:
    Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at PageFrame.<init>(PageFrame.java:41)
    at Main.main(Main.java:4)OK - so it looks like you've found a command line!
    You read these stack traces from the top down. Often the most interesting line is the first line that refers to your code. In this case line 41 of PageFrame.java which, I guess is this:
    ImageIcon icon = new ImageIcon(PageFrame.class.getResource(
            "images/skillimages/" + skillnames[i] + ".gif"));The ImageIcon constructor is grumbling about being told to construct an icon from a null resource. getResource() will return null if it cannot find the resource that you specify.
    The first thing to do is check that the .gif image is where it should be. You have specified it as "images/skillimages/etc" so use the command line to view the contents of the .jar file (or maybe Eclipse will let you do this). Next to PageFrame.class there should be a folder "images" and within it a folder "skillimages" and within that the image file. If not then your jar export has been seen up wrongly and is not including the required resource files.
    (The "View" command is explained here: [http://java.sun.com/docs/books/tutorial/deployment/jar/view.html].)
    Next check the case of the file names. On Windows getResource() will not worry about the cAsE of filenames so the resources will be located fine when running the program unjarred (including within Eclipse). But it does worry about the case of jar entry names. Bottom line: keep the file names all lower case because you use them that way in the code.
    Finally, in case it is a particular image resource that's causing the problem you could add some code to print out its name just before you try and create the icon.
    for (int i = 0; i < skills.length;i++){
        System.out.println(
                "About to make icon from " + "images/skillimages/" + skillnames[i] + ".gif");
        ImageIcon icon = new ImageIcon(PageFrame.class.getResource(
                "images/skillimages/" + skillnames[i] + ".gif"));
        skills[i] = new JLabel("00",icon,JLabel.CENTER);
    }

  • Double click on JAR file to execute it.... How???

    Hello,
    I wrote a standalone java application, and im wondering how to put a shortcut on my desktop to run the application without having to go into the command prompt to type "java -jar MyProgram.jar".
    I want to be able to just double click on it and have it run. Is there a way to do this?

    Here is how I did it:
    Just install the JDK/JRE and then make a shortcut to the jar file you want to execute. When you install the jre jar's are registered and all you need do is double click them. I've done this in windows 95, 98, Me, NT, and Win2000.

  • Required jar files to execute WLSTInterpreter.execfile

    Hi,
      I am trying to automate Domain creation and deployment of application via script file. I have written the commands in a file called createDomain.py. I would like to execute this script file through java code. What are all the jar files required to be in class path to execute this script. I have included initially weblogic.jar file and later got one another after another while including the required jar files. Looks like there are too many jar files to be included in class path which i am not sure. Is there any simple way of executing this script file from java code.
    Below is the code to execute the script file:
    WLSTInterpreter interpreter = new WLSTInterpreter();
    interpreter.execfile("/home/user0/createMNDomain90.py");
    Another question is whats the best way to automate execution of this file.

    if you execute the setWLSEnv.sh you can see the CLASSPATH settings, for Example:
    [oracle@vSLLGM132 ~]$ source setWLSEnv.sh
    CLASSPATH=/opt/oracle/product/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/JAVA/jdk/lib/tools.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/product/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/product/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/opt/oracle/product/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/JAVA/jdk/lib/tools.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/product/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/product/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/opt/oracle/product/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/JAVA/jdk/lib/tools.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/product/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/product/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/opt/oracle/product/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/product/JAVA/jdk/lib/tools.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/oracle/product/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/product/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/oracle/product/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
    PATH=/opt/oracle/product/Middleware/wlserver_10.3/server/bin:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/oracle/product/JAVA/jdk/jre/bin:/opt/oracle/product/JAVA/jdk/bin:/opt/oracle/product/Middleware/wlserver_10.3/server/bin:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/oracle/product/JAVA/jdk/jre/bin:/opt/oracle/product/JAVA/jdk/bin:/opt/oracle/product/11.2.0/dbhome_se/bin:/opt/oracle/product/11.2.0/dbhome_se/OPatch:/opt/oracle/product/Middleware/wlserver_10.3/server/bin:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/oracle/product/JAVA/jdk/jre/bin:/opt/oracle/product/JAVA/jdk/bin:/opt/oracle/product/Middleware/wlserver_10.3/server/bin:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/oracle/product/JAVA/jdk/jre/bin:/opt/oracle/product/JAVA/jdk/bin:/opt/oracle/product/Middleware/wlserver_10.3/server/bin:/opt/oracle/product/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/oracle/product/JAVA/jdk/jre/bin:/opt/oracle/product/JAVA/jdk/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/oracle/bin:/opt/oracle/bin
    You can copy and paste the CLASSPATH to your program.

  • Cant open .jar files

    Hey i need help on opening .jar files..:(
    I got Nokia pc suite , and whenever i try to open the .jar file it opens with nokia pc suite , so i changed the "Open With" to the java.exe , but whenever i try to open it , it just open the Command Prompt and then closes down :(
    I tried many java applications, but it seems non works :(
    Heres an image if you wanted to see
    http://i182.photobucket.com/albums/x293/akisboy32/Java.jpg
    And yes my Environment variables i got this
    Variable : value
    CLASSPATH CLASSPATH=C:\Program Files\Java\jdk1.6.0_02\bin;%CLASSPATH%;
    PATH C:\Program Files\Java\jdk1.6.0_02\bin
    System Variables
    CLASSPATH C:\Program Files\Java\jdk1.5.0_06\bin\javac.exe
    I dont think theres any wrong with the Variables..
    Help please!
    thanks

    Stepwise:Windows Explorer
    Tools
    Options
    Folder Options...
    File Types
    (Select Jar     Executable Jar File)
    Advanced
    (Select open)
    Edit
    Action
        open
    Application used to perform action:
        "C:\Program Files\Java\jre1.6.0_02\bin\javaw.exe" -jar "%1" %*
    Use DDE
        checked
    DDE Message
        (leave blank)
    Application
        javaw
    DDE Application not running
        (leave blank)
    Topic
        System
    OK
    OK
    OKThese are the settings on my system, you may want to substitute java.exe for javaw.exe. Also change the path if it is different on your machine.
    db

  • Cant use jar file - JAVA -

    - JAVA -
    Basically I have few files in one package in every one of them I worte:
    "pack preyPackage;"
    And I have some .jar file that I try to use. So I drag it into the oracle compiler, but I still couldnt use it. But if I delete the row:
    "pack preyPackage;"
    from each .java I able to use that .jar file.
    my question is how can I still use that .jar file and package's all that other files..
    Picture that shows the problem:
    http://hwzone.co.il/community/index.php?action=dlattach;topic=290416.0;attach=92107;image
    Thanks.

    Tried it and get strange behaviours in JDev 10.1.3.3...
    The latest version with sources can be found at
    http://stwww.weizmann.ac.il/G-CS/BENARI/oop/index.html
    You should get that one and modify the sources to include a package name.
    I have little time to do that because I'm going on holiday for a week...
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can't get JAR file to work

    I am currently having problems getting the JAR file for my program to work properly. Here is what I'm doing in creating it and trying to run it:
    1.I create the JAR file with the command "jar cf myjar.jar *.class"
    2.I create a manifest file to point to the main class which contains only the line "Main-Class: MainClass". This is WITHOUT the .class extension
    3.I update the manifest for the jar archive with the command:"jar umf textfile myjar.jar"
    4.I try to run the app with the command "java -jar myjar.jar" but this only gives me an error that says "Failed to load Main-Class manifest attribute from
    myjar.jar"
    Am I doing something wrong here? I've tried to make my steps as close as possible to those that I read in the tutorials, but it's still not coming out for some reason. My computer does recognize the file as a JAR though since it made an icon of a JAR file for it. Please note I made up names for both my jarfile and main class file for privacy reasons, but I do not think the specific names would make much of a difference in this as they contain no special characters or anything in the file names.

    Hmm....I tried both of your tips javagalaxy and tsith by making the file look as javagalaxy posted as well as renaming it to "manifest.mf" and putting it in a "META-INF" folder that is in the same directory as all my .class files. I also made sure I hit Enter twice so that there was a blank line between the Main-Class line of the file. When i run the command it displayed "added manifest" as well as all the class names that I needed to be in the jar file including the main one that I'm trying to invoke. Despite all of that I'm still getting the same error that it can't load the main-class attribute from the jar file when using the command "java -jar myjar.jar" =/. I'm not really sure what went wrong. I tried deleting the extra line so that the cursor was flashing right below the Main-Class line, but that didn't change anything when I re-ran the commands. Did I do something else wrong in the manifest file? Thanks for your help so far! This is some complicated stuff the first time one tries it.

  • How do I get *.jar files to work?

    I don't think that simply saving java files as jar files works by itself. Do I need some kind of converter program?

    Assuming you are using windows 2000, first go to Start > Settings > Control Panel > System > Advanced > Environment Variables. Then make sure the full path of the jar file is included in your CLASSPATH. This is where Java looks to see what packages might need to be included.
    If you are not using Win 2K, then do a search here for "setting classpath" and you will get a ton of info.
    Rebies

  • Cant open jar file

    i cant open any jar file
    it gave that error:
    # java jar_file.jar
    Exception in thread "main" java.lang.NoclassDefFoundError: jar_file/jar
    so what might be the problem!!!!!!!!!!!!!!!!!!

    Everything I've ever read says that a Java Archive file is just a renamed zip file so in theory gunzip should work. After that pkgchk your Java installation or just re-install.
    alan

  • Getting JAR file for Applet doesn't work

    Hi,
    We have the following problem: we have some clients who want to use our applet. There are some clients that have problems with receiving the .jar file:
    When the applet tries to start we get a ClassNotFoundException: 'prestaties.class' not found. (the client wants to acces the class file directly from the server)
    If we check the .jar file, it exists on the client, but the file is empty.
    What could be the problem?
    - PRoxy or firewall blocks the jar file
    - applet doesn't have enough rights to write.
    Does anyone a solution, some workarounds or suggestions for this problem.
    Thanks!
    Luk

    Hi,
    Thanks for answering my question!
    Here is the extra information you asked.
    At server side everything is OK (the jar file is present and has all the class files).
    Where working with Weblogic server 4.51
    The clients run JRE 1.3.0-C
    I can't give you the applet code (confidential) but here is the html code:
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="600" height="80" align="middle">
    <PARAM NAME="cache_archive" VALUE="prestaties.jar">
    <PARAM NAME="cache_option" VALUE="Plugin">
    <PARAM NAME="cache_version" VALUE="1.4.2.1">
    <PARAM NAME="code" VALUE="be.vdab.cvsesf.applet.prestaties.PrestatiesApplet">
         <PARAM NAME="codebase" VALUE="/lib">
         <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
         <PARAM NAME="scriptable" VALUE="true">
         <PARAM NAME="windowId" VALUE="185498422412000">
         <PARAM NAME="cursusId" VALUE="23178">
         <PARAM NAME="opleiding" VALUE="boetseren">
         <PARAM NAME="organisator" VALUE="TESTOE Omschrijving">
         <PARAM NAME="locatie" VALUE="TESTDOSSIER HELKPDESK / 0">
         <PARAM NAME="instructeur" VALUE="TESTDOSSIER HELKPDESK / 0">
         <PARAM NAME="WebLogicSession" VALUE="1">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.3" width="600" height="80" align="middle"code="be.vdab.cvsesf.applet.prestaties.PrestatiesApplet"codebase="/lib"pluginspage="cvsesf/plugin.jsp"cache_option="Plugin" cache_version="1.4.2.1" cache_archive="prestaties.jar" windowId = "185498422412000"cursusId = "23178"opleiding="boetseren" organisator="TESTOE Omschrijving" locatie="TESTDOSSIER HELKPDESK / 0" instructeur="TESTDOSSIER HELKPDESK / 0"WebLogicSession="1">
    <NOEMBED>
    </COMMENT>           
              <html>
                   <head>
                        <title>Java plugin download</title>
                        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                        <link rel="stylesheet" href="../includes/vdabstyle.css">
                   </head>     
                   <body bgcolor="#FFFFFF">
                   <TABLE width="600" border="0" cellpadding="1" cellspacing="0">
                        <tr>
                             <td>               
                                  <h1 align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif">Java plugin</font></b></h1>
                                  <P><B>Voor het invullen van prestaties en vergoedingen heeft u de JRE 1.3 Java Plugin nodig: deze staat op de CD-ROM die u normaal gezien van de VDAB gekregen heeft.<br><br>
                                  Ofwel kan u de plugin hier zelf downloaden (<U>opgelet:</U> bestand is 8 MB groot).<br><br>
                             U kan het VDAB callcenter contacteren om een CD-ROM aan te vragen of om problemen te melden. Het nummer vindt u onderaan het scherm.</B></p>
                             </td>
                        </TR>                    
                   </table>               
                   </body>
              </html>
         </NOEMBED>          
    </EMBED>
    </OBJECT>
    Hope this helps.
    Luk

  • Extract contents of a .Jar file or executable jar file

    I have an executable Jar file.. Is there anyway that I can see the contents of this file.. the code in it..
    I have read some tutorials on how to extract .jar files but the question is where do i execute these commands.. is it on the command window or somewhere else.
    Can anyone help me plz????????

    but the question is where do i execute
    these commands.. is it on the command window or
    somewhere else.
    If you're using windows OS, you can do execute the
    command in dos promt
    and if you're using linux, you execute it in the
    Terminal/Console or double click on the file name in
    the
    Knoqueror, you can see the contents.Konqueror file manager,you can see the contents.

  • Make "jar" files true executables: allow to pass in params in manifest!!

    Right now a jar file's manifest can have a "main-class" which makes the jar truly executable - you can double-click it. The problem is, if you need environment variables, there is no way to pass them in to your main-class' "args."
    So why don't we make it so when the jar's manifest is read, that in addition to "main-class" you can have "main-args"?
    That would mean everyone would no longer need to bundle java apps with ".exe" or ".bat" or ".sh" files!!! We could have truly Java applications, that are executables!!!
    Just package them in a jar, have a main class and the args for it!!
    what does everyone think?

    Right now a jar file's manifest can have a
    "main-class" which makes the jar truly executable -
    you can double-click it. The problem is, if you need
    environment variables, there is no way to pass them in
    to your main-class' "args."
    So why don't we make it so when the jar's manifest is
    read, that in addition to "main-class" you can have
    "main-args"?
    That would mean everyone would no longer need to
    bundle java apps with ".exe" or ".bat" or ".sh"
    files!!! We could have truly Java applications, that
    are executables!!!
    Just package them in a jar, have a main class and the
    args for it!!
    what does everyone think?OK, in reading the conversation I realize you need to be more specific. You are interested in passing parameters to the JVM, not to your application. Is this correct?
    If so, I understand what you are looking for. But this is handled by the system properties class. If you have some JVM parameter you need to set from the command line, besides memory and other USER ONLY parameters, they should be set by system properties. If they don't show up in system properties, then you need to request that they do.
    A jar file is already a cross platform executable of sorts. Why do you think its not?

  • Difficulty in getting jar files for jstl

    Dear dudes,
    I'm using tomcat 5.5 and i do want to work on jstl tags.
    So,i'm finding it difficult to get the jstl.jar, standard.jar files .
    I even went to jakarta site but somehow couldnot ping to the right url.
    So any help in this regard will be appreciated.
    Thanks!
    Note: My mail id is: [email protected] ( please send it to this id if you have those resources)_

    The download page for JSTL is here
    Its not that hard to find is it?

Maybe you are looking for