Running with java -jar

I have a client.jar that has a bunch of vm parameters and relies on a few other jars. The jar has the main class specified in the manifest. Ultimately I would like to take the dependent jars and put them in the client jar and use the manifest classpath option. I have been unable to get this to work. What I am finding is that running with java -jar basically ignores all of my vm parameters. I have tried removing the dependent jars and referencing them from the command line classpath argument. This still did not work. The only thing that has worked is not using a client.jar at all and just running my main class with all the vm parameters. This is not an acceptable solution for me. Thoughts?
Thanks,
Howard

Yes, this is what is so weird about the problem. Neither the manifest class-path option or running with cp is working when the main class lives in a jar.

Similar Messages

  • .jar file only works with 'java -jar'

    I have a .jar file that contains an installer. When I double click it nothing happens on my work computer (vista32). I have tried moving it to my home computer (vista64 and winXP) there it works fine when I double-click it.
    I have found a temporary solution for the work/vista32 machine. If I run it with:
    java -jar installer.jar
    it works. I have put this in the target of a shortcut to the file. But why do I need to do that manually when it works fine on my other machine by just double clicking the file?

    fedevaps wrote:
    Thing is that if I move this jar to another machine it works fine! The thing is that you are missing the point.
    It has nothing to do with the jar. Nor really java.
    Double clicking works because the OS (windows not java) understands what to do when you double click.
    If the OS (windows not java and definitely not the jar) does not understand then it doesn't work.
    So there are two independent parts.
    1. Create an executable jar.
    2. Create the correct association in windows.
    If you use the command line then you can absolutely verify that the first works. If it works then it means, absolutely (no other possibility) that if double clicking fails then the association, not the jar, is wrong.
    If it doesn't work then it means absolutely (no other possibility) that the jar, not the association, is wrong.

  • Up an running with Java. What tools to download?

    Hello, I use to work with Java applications about three years ago, but had switched over to another language. Now I need to develop code using Java again. In fact, I need to reuse some of the code I developed a few years ago. The code does alot with animations. So here is my question.
    "What tools do I need to get up and running with Java?"
    1. What compiler to use (recommend the best open source editor, or one that is not that expensive)?
    2. Where is the Java SDK that I need to download?
    3. Will my three year old code still be compatible with the SUN, Java code I wrote 3 years ago?
    Ralph

    Actually Jwenting is right, IntelliJ is by all measures the best IDE.
    I have used textpad, programmers notepad (which I still use for some things), VIM, eclipse for a number of years, intelliJ for a short time, and Netbeans since earlier this year.
    textpad - Great place to learn the basics, but once the basics are down you need to find an IDE.
    Programmers notepad - love it, still use it for some languages, has some features you will find nowhere else
    VIM - You have your vi lovers and your vi haters, I would say I fall into the haters camp but still keep up with it because when you need an editor to make a quick change on some obscure system with very little on it, some version of Vi will undoubtedly be there. Once you get into the flow it is not bad, but there is lots of annoying things about vi and its offspring.
    Eclipse - Great IDE, was the better of the free ones for a long time. For me eclipse's strength became it's albatross. That is plugins ofcourse. There are literally thousands of plugins that can make eclipse do just about anything you want. The problem is there is very little oversite so some plugins are great, some good, some ok, some suck, and some are deliberately hostile. You don't really know what you are going to get until you try it, but removing it can be a pain so sometimes you are stuck. Plus getting the plugins to play nice with each other can be a chore, the more plugins you have the harder it gets to get new ones to play nice. It was after a whole day stint trying to get eclipse to work again after picking a bad plugin that i simply decided to give netbeans 6.0 a try since it had what I wanted packaged in already.
    IntelliJ - Only got to use this for a short time as they went ahead and bought it at my last job after I gave my months notice for leaving. Guess they figured it would be easier to replace me that way. From the little I got to play with it, it was extremely user friendly to the point of being a pleasure to work with, You definitely got what you paid for.
    Netbeans 6.0 and higher - Netbeans pre 6.0 sucked. Even 5.5 was not as good as eclipse at the time of it's release, but was a sign they were headed in the right direction. After releasing version 4 only to have it suck and laughed at in the java community since eclipse was hundreds of times better Sun realized netbeans was making them look bad. So they decided to fix that and decided the best way to fix it was to model netbeans as closely after IntelliJ (which was the best even back then) as legally possible. With each release they get closer to realizing this goal, and since it is free with each release netbeans picks up more and more former eclipse fanbois. It is now at the point where most people following the eclipse vrs netbeans war will agree that netbeans has taken the lead and has more current users than eclipse. I would even wager that most of the people who said netbeans was best in this thread were not long ago eclipse fans. Bottom line, of the free IDEs netbeans is the better choice at this point.
    But I got to ask, when you say a salary of R8,000 - R12,000 do you mean monthly income or annually? If annually can you even survive on about $1,000 in US dollars for a year? I mean I make about 8 times that in a month, after uncle sam takes his portion, and i wouldn't call myself rich by any means.
    Also jwenting have you tried the newer netbeans? I think if you do you will see they are strikingly similar to IntelliJ in many ways.
    JSG
    Edited by: JustSomeGuy on Dec 5, 2008 7:24 AM

  • Help with Java JAR file opbfuscation.

    I am looking for a free (no $) for use on commercial java code
    code obfuscation program, which can beat the Jode decompiler.
    I have tried Proguard, and I have tried Joga
    (using Jode itself for obfuscation is too complex for my purposes).
    Is there a simple way to beat decompilers like Jode and DJ,
    without a financial outlay if possible,
    given how easy it is to decompile Java bytecode?

    All interesting remarks, everyone!
    Proguard doesn't prevent decompilation on something very small, like a jar
    with one or two classes.
    Proguard is free(no money) for use over commercial java code,
    and is itself a java jar, so it will run on Windows,
    Mac and Linux platorfms.
    It also correctly obfuscates and links external java libraries
    and references to the man jar/class in a very systematic way.
    I'm just wondering if there is something similar to proguard on licensing arrangements,
    working over small amounts of code, and beating
    the decompilers (like Jode).
    I have used the code obfuscation that Dr.Java performs on it's classes during compilation.
    And while the resulting class file tested does confound Jode,
    JD-Gui ("Java decompiler") instantly beats the results of Dr.Java.
    Considering how easy it is to break class files, I was figuring that either Sun
    or another would offer a free/open source/cheap way to secure these class files,
    without resulting to Zelix Klassmaster, and instead of leaving a mess
    of decompiled source code, prevent decompilation of java byte
    code even happening at all?
    Any ideas?
    Edited by: Zac1234 on Jul 5, 2009 10:55 PM

  • JDev 11 on linux with java -jar jdevstudio11110install.jar not working

    My environment was working great until a few days ago, then kaboom. Now I'm trying to pick up the pieces and can't seem to be able to install JDeveloper. I am using Fedora 10.
    Logged in as myself, the default version of java is 1.6.0_13.
    $ java -jar jdevstudio11110install.jarI get the install screen. I can't press the next button. It just won't work. I then CTRL-C to get back to the terminal, and with this version of Java, I have to kill -9 the PID found using the command
    ps -efIf I perform the same steps as root, I can install JDeveloper, but then I can only run it as root. When launching jdev as myself, I get a blank "Select Role" screen.
    Thanks, Ken

    Olaf,
    I uninstalled 1.6.0_13, and installed 1.6.0_12, and still have the problem of not being able to press the next button. Here is the text from my terminal window. After not being able to click the next button, I switched windows and when I switched back, the Oracle window was empty of content. I pressed CTRL-C to close the window.
    I checked, and I don't have selinux running. Below is from my yum.log that shows updates for the last few days. I don't know if any of these caused the problem, but I really am not sure. I'm getting to the point of needing to run jdeveloper in windows in a virtual machine...
    [klee@c5ybv91 Download]$ java -Djava.io.temp=/home/klee/temp -jar jdevstudio11110install.jar
    Extracting 0%....................................................................................................100%
    ^C[klee@c5ybv91 Download]$
    [klee@c5ybv91 Download]$ java -version
    java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
    [klee@c5ybv91 Download]$ Here is the contents of my yum.log for the last few days.
    Mar 23 07:46:54 Updated: thunderbird-2.0.0.21-1.fc10.i386
    Mar 23 07:46:56 Updated: liveusb-creator-3.6.3-1.fc10.noarch
    Mar 23 07:47:14 Updated: ghostscript-8.63-5.fc10.i386
    Mar 24 09:13:12 Updated: selinux-policy-3.5.13-49.fc10.noarch
    Mar 24 09:13:51 Updated: selinux-policy-targeted-3.5.13-49.fc10.noarch
    Mar 24 09:13:54 Updated: libX11-1.1.5-1.fc10.i386
    Mar 24 09:13:57 Updated: ffmpeg-libs-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:04 Updated: gtk2-2.14.7-7.fc10.i386
    Mar 24 09:14:20 Updated: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:21 Updated: lcms-libs-1.18-1.fc10.i386
    Mar 24 09:14:22 Updated: postgresql-libs-8.3.7-1.fc10.i386
    Mar 24 09:14:22 Updated: lcms-1.18-1.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-devel-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:26 Updated: ffmpeg-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:26 Updated: xorg-x11-drv-vesa-2.2.0-3.fc10.i386
    Mar 24 09:14:31 Updated: libX11-devel-1.1.5-1.fc10.i386
    Mar 24 09:14:40 Updated: gtk2-devel-2.14.7-7.fc10.i386
    Mar 24 09:14:40 Updated: ffmpeg-devel-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:17:01 Installed: kmod-wl-2.6.27.19-170.2.35.fc10.i686-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: kmod-wl-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: broadcom-wl-5.10.79.10-1.fc10.noarch
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386Before the 23rd, I didn't have any updates for about a week, and everything was working fine.
    Thanks,
    Ken

  • JavaMail error with "java -jar" on 1.6

    The following code sends an email. The following ant build script compiles the code, creates a jar, runs the program using "java Test", and runs the program using "java -jar test.jar". Both runs work with Sun's 1.5 JRE. With Sun's 1.6 JRE, it does not work when using "java -jar" (my output is following the code). I am not sure why. I thought it might be conflicting versions of JavaMail and the JAF in Java6, but I have the latest JavaMail. I guess it is an issue with how libraries are loaded when using "java -jar", but I am not sure how to resolve this.
    If you want to run this, simply drop mail-1.4.1.jar and activation-1.1.1.jar into the same directory as these two files, set your.mail.server.here and [email protected], and run ant.
    Test.java
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class Test {
        public static void main( String[] args )
            throws Exception {
            String host = "your.mail.server.here";
            String from = "[email protected]";
            String to = from;
            String subject = "Test JavaMail";
            Address[] toRecipients = new Address[1];
            toRecipients[0] = new InternetAddress( to );
            Properties properties = System.getProperties();
            properties.put( "mail.smtp.host" , host );
            Session session = Session.getDefaultInstance( properties, null );
            MimeMessage message = new MimeMessage( session );
            Address fromAddress = new InternetAddress( from );
            message.setFrom( fromAddress );
            message.setRecipients( Message.RecipientType.TO, toRecipients );
            message.setSubject( subject );
            message.setText( "this is the body" );
            Transport.send( message );
    build.xml
    <project name="test" basedir="." default="all">
        <property name="jar.path" value="test.jar" />
        <path id="classpath">
            <pathelement location="mail-1.4.1.jar" />
            <pathelement location="activation-1.1.1.jar" />
        </path>
        <target name="clean">
            <delete>
                <fileset dir=".">
                    <include name="${jar.path}" />
                    <include name="Test.class" />
                </fileset>
            </delete>
        </target>
        <target name="build">
            <javac destdir="." srcdir=".">
                <classpath refid="classpath" />
                <include name="Test.java" />
            </javac>
        </target>
        <target name="jar">
            <manifestclasspath property="mf.classpath" jarfile="${jar.path}">
                <classpath refid="classpath" />
            </manifestclasspath>
            <jar destfile="${jar.path}" basedir="." update="no" index="true">
                <include name="Test.class" />
                <manifest>
                    <attribute name="Manifest-Version" value="1" />
                    <attribute name="Class-Path" value="${mf.classpath}" />
                    <attribute name="Main-Class" value="Test" />
                </manifest>
                <indexjars>
                    <path refid="classpath" />
                </indexjars>
            </jar>
        </target>
        <target name="run">
            <echo message="This will work in 1.5 and 1.6" />
            <java classname="Test">
                <classpath refid="classpath" />
                <classpath location="${jar.path}" />
            </java>
        </target>
        <target name="runjar">
            <echo message="This will not work in 1.6" />
            <java jar="${jar.path}" fork="true" />
        </target>
        <target name="all" depends="clean,build,jar,run,runjar" />
    </project>
    output (with 1.6)
         [java] Exception in thread "main" javax.mail.MessagingException: IOException while sending message;
         [java]   nested exception is:
         [java]     javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii
         [java]     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
         [java]     at javax.mail.Transport.send0(Transport.java:189)
         [java]     at javax.mail.Transport.send(Transport.java:118)
         [java]     at Test.main(Unknown Source)
         [java] Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii
         [java]     at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:870)
         [java]     at javax.activation.DataHandler.writeTo(DataHandler.java:301)
         [java]     at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
         [java]     at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745)
         [java]     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
         [java]     ... 3 more

    I spent quite a bit of time looking into this. Thanks for the reproducible test
    case, it was essential to figuring out the problem!
    The problem appears to be a bug in the jar file index. The jar file index doesn't
    include the META-INF directory, which means JavaMail can't find the config
    files it's looking for in mail.jar. If you change the ant build file to set index="false",
    it will work as expected. If you really need the index, you can fix it by using
    the jar command explicitly - "jar i test.jar".
    It looks like this is a bug in ant.

  • Launching classes with java -jar option

    hi all,
    i have read how to launch a class using the -jar option.
    Now i have one additional question.
    Suppose that the class that i want to launch contains packages from other jar files.
    Can i pack all the other jar files in the same jar, and have the code run by simply calling
    java -jar MyClass?
    if different jar packages are in the same jar file, can the main class that i want to launch see them?? or do i still
    have to specify the -cp option??
    thanx in advance and regars
    marco

    I don't know about having jar files in a jar file, but if you have class files in a jar file, you can make it so you just have to run it as
    java -jar MyJar.jar
    To make the jar file, you need to add an attribute to the manifest file. Make a text file and call it whatever you want, e.g. manifest.mf or manifest.txt.
    Add this line to it:
    Main-Class: MyMain
    if MyMain is your class with the main method. If MyMain is in a package, then you need to add that too, e.g. mypackage.MyMain.
    Now create your jar file as
    jar cfm MyJar.jar manifest.mf *.class
    After manifest.mf you add all the classes you have with spaces to separate them, or use wildcards.

  • Getting error while running command java -jar oc4j.jar -install

    java -jar oc4j.jar -install
    ON RUNNING The above command getting below error , is it because Java home is not set?
    Warning: -jar not understood. Ignoring.
    Exception in thread "main" java.lang.NoClassDefFoundError: oc4j.jar
    at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
    at JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
    at JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
    at __gcj_personality_v0 (/oracle/u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/home/java.version=1.4.2)
    at __libc_start_main (/lib/tls/libc-2.3.4.so)
    at JvRegisterClasses (/oracle/u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/home/java.version=1.4.2)
    navisdb.igglobal.com(express)$ javac
    ksh: javac: not found
    ENVIORNMENT DETAIL : RED HAT LINUX ENTERPRISE EDITION
    Extracted OC4J_extended.zip file at oracle 10g installation location.

    does this command work?
    /home/oracle:MCSE>gij --showversion
    gij (GNU libgcj) version 3.4.6 20060404 (Red Hat 3.4.6-11)

  • Problem running with "java class"

    Hi:
    I developed an application in Forte. It works as expected within the IDE. I would like to run it outside the IDE with "java application.class". When I try this, it cannot find many modules. I realize I need to set the classpath, but don't know what to set it to.
    Please help.
    vjktm

    r u using windows?
    if so
    try this
    open up the dos
    then type the following command
    set classpath = drive:\directory\.
    drive - your working drive
    directory - where you put ur java source and class files
    make sure you have the . at the end of the cammand.

  • JFrame running with Java Web Start

    I have a problem with running my application with Java Web Start. My main application window is a JFrame and I have a line of code as below
    this.setExtendedState(MAXIMIZED_BOTH);
    It runs fine when run on a PC locally. But if I try to run the application through Java Webstart I get an exception. Can anyone help me with this. I would like the JFrame to open maximized.
    TIA.

    try posting the exception to get better answers. but anyway, i'm guessing its a security issue... your app is trying to access the properties of the local system. you might have to sign your application for this to go away.

  • How to get applets running with Java Plug-in on Win but also on Mac OS X???

    I've converted to the use of Java Plug-in for my applets, but I need to have those same applets executable from browsers on Mac OS X platform. Surely this has been done, but I don't see how. The browsers I've tried on Mac OS X (Netscape, IE) don't seem to recognize the <OBJECT> tag used for the java plug-in. I've seen no news about the Java plug-in being ported to Macs. How can one get the same applet to run with the Java plug-in on Windows browsers, and also to run with at least one of the common browsers on Mac OS X? Any help would be SO much appreciated!

    Those ten dukes look good to me. But the passing of fifteen months has me thinking you've probably moved on. In any case, here's my effort.
    I've been through a trial trying to get my applet, developed with 1.4.1_03, to run on my Mac OS X v.10.2.6 in multiple browsers. I'm posting my results here. Comments and feedback are welcome.
    JVM support for 1.4.1 is limited to the Safari browser. All other browsers running in Mac OS X that I've tried ( Camino, Opera, Internet Explorer, Mozilla ) are using the 1.3.1 plugin. According to a bug report by Mozilla on this topic ( see Bugzilla Bug # 197813 http://bugzilla.mozilla.org/show_bug.cgi?id=197813 )
    with the release of Apple's version of Sun's Java 1.4.1 the applet programming model has changed, and only Safari has adapted with this change. Other browsers, according to the report, could not because of a lack of documentation. The use of the MRJCarbon plugin offered by Mozilla (here - http://www.mozilla.org/oji/MRJPluginCarbon.html) only allows Mozilla to use the J 1.3.1. And I have not found any information on the Microsoft site about how to get IE 5.2 to recognize the newer version of Java.
    Regarding the use of the OBJECT tag in Safari, it is a matter of debate. A current post on this topic exists in the Applet Development forum:
    http://forum.java.sun.com/thread.jsp?forum=421&thread=441002
    In my experience, I have not been able to determine that Safari v1.0 recognizes the OBJECT tag. My experience is that the APPLET tag is required to run applets in Safari. The Bugzilla report echoes the problem with the BadMagicNumber error that can arise in Safari. Nonetheless, I enjoy Safari and I enjoy Mac OS X.

  • Err. in programs copiled with Jdev 9.0.3 and run with Java Web Start

    Hi all,
    when I build my programs with Oracle9j JDeveloper 9.0.3.988 and I use them with Java Web Start, programs do not run, while when compiled with Oracle9j JDeveloper 9.0.2.x it runs without problems.
    The Java version used in both cases is 1.4.0.
    Here's an example of the log from Java Web Start:
    Error in JavaWeb Start
    viewer/imageViewer/ViewerAppState$1 (Illegal Variable name " val$files")
    java.lang.ClassFormatError: viewer/imageViewer/ViewerAppState$1 (Illegal Variable name " val$files")
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$1(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at viewer.imageViewer.UtilityMenuPane.jbInit(UtilityMenuPane.java:167)
         at viewer.imageViewer.UtilityMenuPane.<init>(UtilityMenuPane.java:155)
         at viewer.imageViewer.UtilityMenuPane.getInstance(UtilityMenuPane.java:147)
         at viewer.imageViewer.ImageViewerFrame.jbInit(ImageViewerFrame.java:179)
         at viewer.imageViewer.ImageViewerFrame.<init>(ImageViewerFrame.java:145)
         at viewer.imageViewer.ImageViewerFrame.getInstance(ImageViewerFrame.java:126)
         at viewer.ImageViewer.execute(ImageViewer.java:30)
         at viewer.Viewer.execute(Viewer.java:63)
         at viewer.Viewer.<init>(Viewer.java:27)
         at viewer.Viewer.main(Viewer.java:40)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:536)
    Does anybody know why this happens?
    Thanks

    Hi There.
    We had the same problem with some of our code. We moved the definition of the class from a method out of the method. Like this:
    public class{
    class{
    instead of doing this:
    public class{
    method() {
    class{
    This worked with the web start......
    Best regards
    Jesper Lorentzen

  • Is ist possible to define heap size when start with java -jar

    Hi,
    I start my application as executable jar. How can I set the heapsize when double clicking myapp.jar ? With java -Xmx512m -jar myapp.jar it should go. But can I specify this when double clicking the myapp.jar ?
    Thanks
    Oli

    For all jars it is not acceptable I think.... the value as entry in the manifest.mf could be nice... :(

  • JNDI validation - problem in Security.runAs with wlclient.jar !!!!!HELP

    Hi,
    I am getting the error given below in calling the following thin client program.
    public static void main(String[] args) throws NamingException
              Security.runAs(new Subject(), new PrivilegedAction(){
                   public Object run() {
                        Properties props = new Properties();
                        TopicConnectionFactory confac = null;
                        props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                        props.put(InitialContext.PROVIDER_URL,CLUSTER);
                        try {
                             InitialContext jndiContext = new InitialContext(props);
                             jndiContext.close();
                        } catch (NamingException e) {
                             e.printStackTrace();
                             System.exit(0);
                        return null;
    java.lang.SecurityException: SubjectManager not installed
         at weblogic.security.subject.SubjectManager$1.createAbstractSubject(SubjectManager.java:169)
         at weblogic.security.subject.SubjectManager$2.run(SubjectManager.java:285)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.security.subject.SubjectManager.getAbstractSubject(SubjectManager.java:273)
         at weblogic.security.subject.SubjectManager.runAs(SubjectManager.java:234)
         at weblogic.security.Security.runAs(Security.java:48)
         at com.test.jms.JMSConnectionTest.run(JMSConnectionTest.java:62)
         at com.test.jms.JMSConnectionTest.main(JMSConnectionTest.java:55)

    i think that you need create a subject like that.
    LoginContext loginContext = null;
    try {
    loginContext = new LoginContext(username, password, url);
    loginContext.login();
    } catch {}
    Subject subject = loginContext.getSubject();
    Security.runAs(subject, new SimpleAction .......

  • How to make sure an applet runs with Java 5?

    Hi all,
    First let me say thanks for all the help in the past. You've help me go from noob to intermediate noob. I've just about finished my first applet game which can be checked out here .
    Now I've been reading about problems with mac and 1.6. (note it works on Linux). I want to make sure that it runs fine and of course I don't own a mac. So I downloaded the 5 JDK. Selected it as the java platform in Netbeans, compiled and it ran fine.
    Questions:
    Do I have to always use 1.5 to compile and perhaps set it as default?
    Since it works in 1.5, do I compile it with 1.6 and just upload?
    I'm worried I'm not testing it correctly. I mean if I have both 1.5 and 1.6 installed on my machine, how to I make sure the applet is only using 1.5 to run?
    Thanks
    Darrin

    corlettk wrote:
    I haven't got a clue RE your problem other than for max-portability you should compile with [-target 1.5|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html].
    I must say I'm impressed, except I suspect my PC must be substantially faster than any of your test platforms... can you throttle it to CPU performance somehow? Or maybe it's just that my reflexes aren't what they once where.Thanks.
    There seem to be two issues. The first is what people are using. This web stats shows pretty poor penetration of 1.6.
    [http://www.statowl.com/java.php|http://www.statowl.com/java.php] Penetration: 54% with JRE1.6 + 19% with JRE 1.5. Total 73%.
    The second is I've read that mac and 1.6 do not get along except on a 64bit platform.
    So for applets there is not much choice but to compile on 1.5 for the broadest user base. I guess the good news is 1.4 and earlier are almost non-existent.
    Edited by: Darrin.A on Apr 27, 2009 8:11 AM

Maybe you are looking for

  • Re: Display format in ALV report

    Hi Expert, I have develop an alv report with some like lifnr,name1,dmbtr,budat,zterm, But my requiremnt is output should come in the below format like vendor number   vendor name   payment tern     jan          feb                mar            april

  • Sould i buy the white 4g ipod touch, or wait for the 5g ipod touch?

    I have the third generation ipod touch, and i love it but it doesnt have a camera. I was waiting for the fifth generation to come out but instead they released the same model but in white. Now i don't know if i should wait another year to buy the ipo

  • Can the intervals in reminders be increased? Need a 2 monthly reminder.

    Can the intervals in reminders be increased? Need a 2 monthly reminder.

  • Help menu options change all the time - repair install always shows

    After installing Acrobat X, I noticed the Help menu options change all the time.  The repair install option is always present and sometimes the deactivate option is present but grreyed-out, somtimes it is enabled and most of the time it doesn't even

  • Help w/4.5 OS upgrade

    I have installed the 4.5 OS on my BB 8330, but when I try to download certain apps, it says I have an OS below 4.1.  In the About menu, I have 4.5. I can't use the VZappzone from Verizon either and I should be able to.  How can I fix this?