Page 4 of 4 First ... 234
  • Jump to page:
    #46
  1. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,581
    Rep Power
    1906
    Did you look/tried what we suggested?

    The good thing with math is that it can learn about logic, but programming is more than just math.

    Like a mechanical has a box with all the tools, the programmer also has a box with tools, which is all the programming language.

    But I will agree with you on one thing: Developer mostly learns how to use the tool, but not necessarily when to use what. (If someone can prove me wrong, I will only be happy about it )

    If you think c++ is better for what you need, then you use that.

    I don't know for C++, but let's say it's .cpp --> ?? --> .exe.
    Depend on the size of the projects, you can have several .exe and .dll files.
    A very non-directly comparison could be to compare the Jar file with a "standard" installation file (e.g. .msi for Windows).
  2. #47
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    Originally Posted by MrFujin
    Did you look/tried what we suggested?
    You might be referring to getting the jar file created? My issue now is about portability.

    Now, believe it or not, a half-miracle happened. I figured out how to create .exe files in Java.

    I Wikipedia'd Jar files and there was a section about converting to .exe, with the 1st suggestion being download a program called JSoft that converts .jar to .exe.

    And I got that successful. However, I still have the same problem with .jar, it doesn't work defaulty on other computers. I copied itinto my stick drive, plugged it in my old laptop, and only an error sound when I double-click it.

    So C++ wouldn't help it either.

    I guess the portability issue here is what's something all Windows by default support that can make alerts/popups like JOptionPane or dialogs like JPanel.

    So I'm guessing a .exe in C++ could be the same issue.

    Originally Posted by MrFujin
    A very non-directly comparison could be to compare the Jar file with a "standard" installation file (e.g. .msi for Windows).
    I guess what you're hinting to me now is to learn .msi files or MSI programming.
  4. #48
  5. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Java class files created as java version 1.7 will not execute with earlier versions of java.
    jar files will execute on more different OSs than an exe file.
  6. #49
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    Originally Posted by NormR
    Java class files created as java version 1.7 will not execute with earlier versions of java.
    Would this have anything to do with the compiler? It probably tells with what Java version it makes class files of?

    I guess I will try to download an older compiler, since that's all I know.
  8. #50
  9. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Yes, the compiler sets the class files version.
  10. #51
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    I forgot to ask, you think the Java version is the issue?

    If I go on a Windows and the command prompt doesn't recognize java, javac, or jar as a command, is it safe to assume jar files won't execute?

    Thanks.
  12. #52
  13. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    the command prompt doesn't recognize java
    On windows, the JRE installation process copies the java.exe file into a folder that is on the PATH. The javac.exe file's folder is not usually on the PATH. The OS can find/recognize files that are on the PATH.

    Also in the installation an association entry is made in the registry for jar files with a commandline to execute when a jar file is opened. If there isn't a java program or an entry in the registry, the code in a jar file won't be executed.
  14. #53
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    Originally Posted by NormR
    Also in the installation an association entry is made in the registry for jar files with a commandline to execute when a jar file is opened. If there isn't a java program or an entry in the registry, the code in a jar file won't be executed.
    I guess this means if there is no Java SE installed, or the JDK, no jar files can be executed.

    I'm at my Dad's computer now, and unlike the other Windows XP, this is a Windows 7, and when I plug in my stick drive and double-click the jar file, I actually get an error message. (Whereas in XP, there was no error popup, only a sound.).

    The error is, could not find main class: ____. Program will exit.

    Of course I think this error message is misleading since I presume the class is already a part of the jar file, so there is a class in the jar file.

    Anyways, I'm trying to download an older IDE. So this jGRASP I cannot find any older versions, they all say "requires Java 1.5 or higher."

    But the Java SE's on Oracle's site don't seem to say what version they are. They all say JDK 7 and Java SE 7.

    I wonder if the 7 means "v1.7."

    Anyways, even after downloading the JDK 7, the jar file still does not execute, I'll try with rebooting.

    Thanks.
  16. #54
  17. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    The error is, could not find main class: ____. Program will exit.
    What version of java gave the error?
    What version of java was used to create the class files in the jar file?

    7 means 1.7
  18. #55
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    There was Java 1.6 installed here.

    And both .jar and .exe returns that error message.

    Now, I just downloaded 1.7.

    Now the .jar executes just fine, however, the .exe pops same error message.

    I wonder that with the XP windows, nothing happened when I double-clicked, that they must be either an older version of Java (like older than 1.6) or no Java installed.
  20. #56
  21. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    To see the error message, open a command prompt window, change to the directory with the jar file and enter the command:
    java -jar THEJARFILENAME.jar
  22. #57
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    Originally Posted by NormR
    To see the error message, open a command prompt window, change to the directory with the jar file and enter the command:
    java -jar THEJARFILENAME.jar
    The jar file works, just not the .exe.

    So I did that. And when I did, the jar executed, so there was no error message.

    But I did that for the .exe file, and that error message is

    Error: Unable to access jarfile Program.exe.

    But all this trial testing answered most of my questions. I will look to see what Java is installed in my other computers and work computers (where no error message popped up and the jar files did not execute). I'm basically curious to see what stuff is default on Windows.
  24. #58
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    I don't know what happened now in my original laptop but every time I open a new tab in Internet Explorer, this thing pops up.



    I clicked allow the 1st 10 times. And I test just by opening and closing tabs, it doesn't matter whether I click Allow, or Don't Allow, this still pops up at every time of opening a new tab.

    This pops up even for a blank tab.

    EDIT: And there's another popup with a blue color that I can't take a screenshot of since it sorts of freezes my computer until I click allow or don't allow, and that's for opening new tabs with designated urls, not blank urls, and the same problems applies whether I click allow or don't allow.
    Last edited by LostShadow; January 28th, 2014 at 04:46 PM.
  26. #59
  27. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Location
    Chicago, Illinois, U.S.A.
    Posts
    98
    Rep Power
    0
    Years ago, I started Java through jGRASP on the school's computer. So I never downloaded it to my laptop. It's only recently that I went to download to my laptop.

    I'm back at my school computer, and I saw the jGRASP is an older version by about 4 months.

    I load my .jar file in, and double-click, and I get yet another error message.

    Here's something to pick your brains some more.

    The error is.

    Windows can't open this file:

    File: Program.jar

    To open this file, Windows needs to know what program you want to use to open it. [etc]

    (But the reason I'm at my school computer is to compile the same code with an earlier version to see if it runs on 1.6). There already is a jdk 1.7 and jre7 at Program Files\Java.

    EDIT: So jre7 may be installed, but there is no java, javac, or jar command avilable in the command prompt. Might be the %path issue, and control panel is blocked on school computer, but I'l obviously try to copy/paste the .java and .class files into my stick drive to my laptop to create a jar, but I guess since this is still 1.7 so it wouldn't be any different.

    EDIT: But I was just thinking, if I uninstall jdk7 and download jdk1.6, that would do it wouldn't it? The jGRASP requires 1.5 or higher.
    Last edited by LostShadow; January 29th, 2014 at 01:09 PM.
Page 4 of 4 First ... 234
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo