Java apps won't run, Java preferences won't launch
Since the flurry of 2012 updates, Java is completely broken on my Mac Pro. Java dependent apps don't start and Apple Support says to enable the apps in Java Preferences.
Nice idea, but Java Preferences WILL NOT LAUNCH either.
There were plenty of tools to address flashback and they DID NOT break normal day to day operations.
I downloaded the package from support to try a reinstallation, but it says "A newer version of Java is already installed" and offers me the option to Close. No reinstall, nothing.
Apple support is at it's usual level of service on this issue, completely INVISIBLE.
What has happened to the Apple I used to know? If any of the smart folks on this forum have a working solution, please share. Deleting preferences doesn't do squat btw.
Thank you.
Ross
If you want uninstall latest Java to install a previous version, open Terminal and issue this command
sudo /usr/libexec/java_home –uninstall
Similar Messages
-
My computer won't run java, why?
my computer won't run java, why?
Apple have recently released an update to Safari removing in-built Java capability. If you want to use Java which I presume you do you must download it from this address;
http://support.apple.com/kb/DL1573
CaitlynL wrote:
my computer won't run java, why?
<Edited by Host> -
Compiling java code from a running java application
How does compiling of java code from a running java application work?
I found a class: com.sun.tools.apt.main.JavaCompiler
but cannot find any documentation of how this class works.How does compiling of java code from a running java
application work?Probably most reliably using Runtime.exec().
I found a class:
com.sun.tools.apt.main.JavaCompiler
but cannot find any documentation of how this class
works.For a purpose. You are not supposed to use this class. With the next JRE release or implementation, it might not exist anymore - it's not part of the standard API. -
I suppose I should attempt a repair, but does anyone know why Java simply does not run on IE sometimes? Ever since I installed W2K a couple of months ago, Internet Explorer has not been able to run ANY Java applets (like AOL AIM Express). I just get a blank box where the applets should be. Is downloading J2RE 1.4.1 my only option?
- Zepfanman.comSe if the MS Java virtual machine is present and activated. (Look for a file named java.exe; if it's a Microsoft file, probably your jvm is not enabled.)
-
There is an java app that I have run for years without any problem Within the last few days it started running very slowly. I went to the Apple store and ran the same app and experienced exactly the same problem
Yesterday I tried running this app on a Windows based machine and it ran perfectly.
I was all set to download the latest java when I saw that Apple supplied the java version on the MAC.
I have run sotware updates and get results that all software is uptodate.
Any suggestions?There are many people who have posted about persistent export failures since the update. A search will uncover a number of threads just within the past month. There doesn't seem to be a pattern to these problems – and if there is common fix, I haven't heard about it.
However, the update hasn't been a problem for me – nor presumably has it been for the majority of users.
Russ -
Java.lang.OutOfMemoryError when running java concurrent program
Hi,
i had written a java concurrent program to create the content items into Oracle Content Manager (OCM). Process the records from interface table and create the content items into OCM by calling the API IBC_CITEM_ADMIN_GRP.upsert_item().
I run the concurrent program with 2000 records in interface table, it's an one to one process, 563 records are processed and 563 content items are created successfully in OCM. After 563 records continuously throws the Exception
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('EX - bundle validation others--');
x_return_status := FND_API.G_RET_STS_ERROR;
FND_MESSAGE.Set_Name('IBC', 'A_BUNDLE_ERROR');
FND_MESSAGE.set_token('SITUATION', 'VALIDATION');
FND_MSG_PUB.ADD;
IF IBC_DEBUG_PVT.debug_enabled THEN
IBC_DEBUG_PVT.end_process(
IBC_DEBUG_PVT.make_parameter_list(
p_tag => 'OUTPUT',
p_parms => JTF_VARCHAR2_TABLE_4000(
'x_return_status', '*** EXCEPTION *** [' || SQLERRM || ']'
END IF;
in IBC_CITEM_ADMIN_GRP.validate_attribute_bundle() API.
Again running the concurrent program it process another 563 records. Can any one help me to fix this issue?
i figured out the exception. When debug the error, i got the actual error message like this
ORA-29532: Java call terminated by uncaught Java exception: java.lang.OutOfMemoryError
ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException
ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException: -2048 < 0
for this issue i increased the heap memory size up to 1024MB. Still i have the same issue. Can any one help to fix the issue?ORA-29532: Java call terminated by uncaught Java
exception: java.lang.NullPointerException
ORA-29532: Java call terminated by uncaught Java
exception: java.lang.ArrayIndexOutOfBoundsException:
-2048 < 0Aren't the null pointer and arrayindexoutofbounds, the ones which you get when you are trying to read beyond your array? (example: when your loop tries to access the 563rd element in your array, since your array index starts from 0)?
May be if you can try to write out your elements in the array, you might see what it is croaking about.
Thanks,
Chiru -
Java application hangs during running java native method
Hello,
There is compiled java application.
It hangs at very begginings.
It was detected that in the beggining a new Frame should be created. Then one java library invokes native method. During invoking of the native method application hangs.
Stack is available only until native method invocation.
Thread 25196 "main": (state = IN_NATIVE)
at sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(Native Method)
at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:181)
at java.awt.Window.init(Window.java:271)
at java.awt.Window.<init>(Window.java:319)
at java.awt.Frame.<init>(Frame.java:419)
at javax.swing.JFrame.<init>(JFrame.java:194)
at com.test.ORBManager.Splash.<init>(Splash.java:10)
at com.test.ORBManager.Splash.main(Splash.java:48)
Method getDoubleBufferVisuals(int screen) is used to enumerates all visuals that support double buffering (according to comments in the source code).
Tried to run with "-verbose" options...
I tried to use jconsole и jvisualvm. But did not find anything special.
Also "strace" command showed some results but do not know how to proceed:
select(6, [5], [5], NULL, NULL) = 1 (out [5])
writev(5, [{"b\0\6\0\r\0\0\0DOUBLE-BUFFER\0\0\0", 24}], 1) = 24
select(6, [5], [], NULL, NULL) = 1 (in [5])
read(5, "\1\0\t\0\0\0\0\0\1\211\0\204\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
read(5, 0x83b57bc, 4096) = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1275494877, 569746}, NULL) = 0
select(6, [5], [5], NULL, NULL) = 1 (out [5])
writev(5, [{"b\0\6\0\r\0\0\0DOUBLE-BUFFER\0\0\0", 24}], 1) = 24
select(6, [5], [], NULL, NULL) = 1 (in [5])
read(5, "\1\0\n\0\0\0\0\0\1\211\0\204\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
read(5, 0x83b57bc, 4096) = -1 EAGAIN (Resource temporarily unavailable)
select(6, [5], [5], NULL, NULL) = 1 (out [5])
writev(5, [{"\211\6\3\0\1\0\0\0&\0\0\0", 12}], 1) = 12
select(6, [5], [], NULL, NULL) = 1 (in [5])
read(5, "\1\0\v\0\f\0\0\0\1\0\0\0\377\32\0\0\377\r\307 \0\0\0\0\0\23\372\300\376\3346\34"..., 4096) = 44
read(5, 0x83c31e4, 36) = -1 EAGAIN (Resource temporarily unavailable)
select(6, [5], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
I have downloaded from the internet the source code of native method but do not know what I can do with it.
Is it possible to debug native method somehow?
How to detect where the library contans the native method is located?
What other ways can provide more information about reason.
It seems that the problem is related to graphics. Judging by class name "X11GraphicsDevice" it is related to X server. May be some server settings?
The problem is present on SLED 11 machines.
It is not reproduced on SLED 10.
I will be really appreciate for any help.
Thanks in advance.
Vasily.Hi,
Thanks for tip. I used jstack. It gives a little bit more info but I have to few knoledges how to treat the info.
----------------- 24231 -----------------
----------------- 24317 -----------------
0xffffe430 ????????
0x6dd12229 ????????
0xb0ca5898 * java.net.PlainSocketImpl.socketAccept(java.net.SocketImpl) bci:0 (Interpreted frame)
0xb0c9fb6b * java.net.PlainSocketImpl.accept(java.net.SocketImpl) bci:7 line:384 (Interpreted frame)
0xb0c9fb6b * java.net.ServerSocket.implAccept(java.net.Socket) bci:50 line:450 (Interpreted frame)
0xb0c9fb6b * java.net.ServerSocket.accept() bci:48 line:421 (Interpreted frame)
0xb0c9fa94 * sun.rmi.transport.tcp.TCPTransport.run() bci:59 line:340 (Interpreted frame)
0xb0c9fe71 * java.lang.Thread.run() bci:11 line:595 (Interpreted frame)
0xb0c9d236 <StubRoutines>
0xb6f38eac _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
0xb7108aa8 _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
0xb6f38705 _ZN9JavaCalls12call_virtualEP9JavaValue11KlassHandle12symbolHandleS3_P17JavaCallArgumentsP6Thread + 0xd5
0xb6f3879e _ZN9JavaCalls12call_virtualEP9JavaValue6Handle11KlassHandle12symbolHandleS4_P6Thread + 0x5e
0xb6fb0765 _Z12thread_entryP10JavaThreadP6Thread + 0xb5
0xb71a9373 _ZN10JavaThread3runEv + 0x133
0xb71096b8 _Z6_startP6Thread + 0x178
0xb781a1b5 start_thread + 0xc5
----------------- 24318 -----------------
0xffffe430 ????????
0x1b7bfaf0 ????????
----------------- 24373 -----------------
0xffffe430 ????????
0xb71087be _ZN2os5Linux14safe_cond_waitEP14pthread_cond_tP15pthread_mutex_t + 0xae
0xb70fe2af _ZN13ObjectMonitor4waitExiP6Thread + 0xa6f
0xb718bdc6 _ZN18ObjectSynchronizer4waitE6HandlexP6Thread + 0x56
0xb6f925e3 JVM_MonitorWait + 0x163
0xb0ca5898 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
0xb0c9fb6b * java.lang.ref.ReferenceQueue.remove(long) bci:44 line:120 (Interpreted frame)
0xb0c9fa94 * java.lang.ref.ReferenceQueue.remove() bci:2 line:136 (Interpreted frame)
0xb0c9fa94 * sun.java2d.Disposer.run() bci:3 line:125 (Interpreted frame)
0xb0c9fe71 * java.lang.Thread.run() bci:11 line:595 (Interpreted frame)
0xb0c9d236 <StubRoutines>
0xb6f38eac _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
0xb7108aa8 _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
0xb6f38705 _ZN9JavaCalls12call_virtualEP9JavaValue11KlassHandle12symbolHandleS3_P17JavaCallArgumentsP6Thread + 0xd5
0xb6f3879e _ZN9JavaCalls12call_virtualEP9JavaValue6Handle11KlassHandle12symbolHandleS4_P6Thread + 0x5e
0xb6fb0765 _Z12thread_entryP10JavaThreadP6Thread + 0xb5
0xb71a9373 _ZN10JavaThread3runEv + 0x133
0xb71096b8 _Z6_startP6Thread + 0x178
0xb781a1b5 start_thread + 0xc5
----------------- 24227 -----------------
0xffffe430 ????????
0x6cbc4021 ????????
0x6cbc232a ????????
0x6cbc3c9a ????????
0x6cc1d5d1 ????????
0x6d41013f ????????
0x6d460f19 ????????
0xb0ca5898 * sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(int) bci:0 (Interpreted frame)
0xb0c9fb6b * sun.awt.X11GraphicsDevice.getDefaultConfiguration() bci:140 line:181 (Interpreted frame)
0xb0c9fa94 * java.awt.Window.init(java.awt.GraphicsConfiguration) bci:51 line:271 (Interpreted frame)
0xb0c9fb6b * java.awt.Window.<init>() bci:66 line:319 (Interpreted frame)
0xb0c9fb6b * java.awt.Frame.<init>(java.lang.String) bci:1 line:419 (Interpreted frame)
0xb0c9fb6b * javax.swing.JFrame.<init>(java.lang.String) bci:2 line:194 (Interpreted frame)
0xb0c9fb6b * com.test.ORBManager.Splash.<init>() bci:3 line:10 (Interpreted frame)
0xb0c9fb6b * com.test.ORBManager.Splash.<init>(java.lang.String[]) bci:4 line:48 (Interpreted frame)
0xb0c9d236 <StubRoutines>
0xb6f38eac _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
0xb7108aa8 _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
0xb6f38cdf _ZN9JavaCalls4callEP9JavaValue12methodHandleP17JavaCallArgumentsP6Thread + 0x2f
0xb6f638b2 _Z17jni_invoke_staticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP6Thread + 0x152
0xb6f54ac2 jni_CallStaticVoidMethod + 0x122
0x08049873 ????????
0xb76c9705 ????????The last stack also has "sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(int) bci:0 (Interpreted frame)" but what tode next?
Also I found that the native code is in java 1.5 source code: \j2se\src\solaris\native\sun\awt\awt_GraphicsEnv.c.
How it is possible to compile it? -
Runing windows 8 and Firefox won't run java script.
I have a new Dell running windows 8. it seems Firefox won't operate with Java script. what suggestions do you have?
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
Also make sure that security software isn't blocking JavaScript. -
Finder won't run/Hard Drive won't mount on restart!!?!
Hey all.
Restarted my Powerbook G4 on OSX 10.4.10 yesterday, and for some reason, the Finder does not run, and the HardDrive icon does not appear. My top bar appears partially, and my Dock appears with all my programs, but the desktop is empty!?!
Some of the programs on the Dock work (hence the internet). and the top bar becomes full when a program opens...but I can't access the Harddrive! Ahhh! There were some files on the desktop and on my HD that I needed, so surprisingly I was able to open up Acrobat, hit open file, and locate and open these files from the desktop or HD, and then save them to a USB drive....but why doesn't my finder work or harddrive mount??
I've zapped the P ram and nothing was fixed, I ran disk utility from my OSX CD...no problems. ***?? I also read somewhere about a divx problem with 10.5...but I ran that fix code in terminal....and it said "no such file or directory"...so it's not a DivX problem
Please help....I need my PB for work ASAP!!
Any suggestions?
Thanks guys....love the site!Hi Johnny88!
What size is the Hard Drive, and how much space is available?
How much of the 512 MB RAM, is original, and how much is added?
What peripherals do you have connected? A keyboard, mouse, printer, external drive or modem, router, etc?
Insufficient available space, can cause this issue, as well as system corruption, and possible data loss.
Depending on Mac system usage habits, it is a general recommendation, to keep 10% to as much as 20%, of the Total capacity, available at all times.
More info here Problems From Insufficient .... Free Hard Disk Space, authored by Dr Smoke.
Suggestions for Freeing Space On Your Mac OS X Startup Disk, authored by Dr Smoke.
Is the Mac shutdown overnight, or does it run 24/7?
Have you ever run any routine Maintenance procedures?
If you turn the PowerBook off nightly, the Background Maintenance Tasks, are never run.
These can also be run, using a Third-Party utility, or manually using Terminal, to run the CRON Commands.
I use MacJanitor, when necessary.
INSTRUCTIONS TO RUN CRON MANUAL COMMANDS
Quit all applications/programs.
Navigate to HD > Applications > Utilities.
Double click on Terminal, to open.
At the prompt, type:
sudo periodic daily
Press Return.
Enter your Admin password when prompted, then press Return.
This will execute the daily script that is sheduled to run every night.
When completed, repeat this procedure, but change the command to:
sudo periodic weekly
This one rebuilds a database or two, and usually takes somewhat longer to complete. It is scheduled to run once a week.
Repeat again, with command:
sudo periodic monthly
Or they can all be run in one pass, which is preferable, with this command:
sudo periodic daily weekly monthly
When the tasks complete, and return to the prompt, you may quit Terminal.
Restart the Mac, and run Repair Permissions.
TO REPAIR PERMISSIONS ON THE STARTUP DISK
1.Open Disk Utility, located in Applications/Utilities, and select the startup disk in the left column.
2.Click First Aid.
3.Click Verify Disk Permissions to test permissions or Repair Disk Permissions to test and repair permissions. (I never "Verify". Just run "Repair".)
When "Repair Permissions" is complete. Quit "Disk Utility".
ali b -
My apps don't run any more, they just launch and close
I have a 3gs, and about 10 days ago I upgraded to 4.3.3. On Saturday, 5/13/11, I was able to use all of my apps. On Sunday when I run any of my non - default apps stopped working. They would launch then close within 1/4 second. This occured for all of the apps I tried, including Flashlight. I could not see a pattern other than the standard apps worked and the non standard don't.
I restarted my phone. same result.
I after doing a backup, I reset my phone and restored from backup. The result was that ALL of my non default apps are gone. Poof. I am working with iTunes to have my apps be reautherized. I am not sure that will fix the original problem.
I did not try to down load a new free app. I wish I had tried that.
The reason for this post is to see if there was some fairly well know problem that I had run into and there was a known fix for the problem. -
Java runtime environement won't run
I have a Lenovo T430 Thinkpad. I have Java (7u67) installed. The applet will run through the browser (firefox), but JRE won't run through the command line. I have a program that uses Java, but that program won't run because JRE won't run. I have uninstalled and reinstalled with no luck. I'm running Windows 7 enterprise. Any help would be appreciated.
ic, thanks for the clarification.
In my classpath, I didn't include the path to java's core classes/packages (java.awt, javax.swing, etc.), how would it know?
The above questions arise when I get an error running the jar executable. In this jar files, I included all the classes (but not the nttp and the core java packages). It complains that nttp is not found. I guess it knows where the core java classes but beside those, I need to include any other packages/classes within the jar file itself?
H:\Documents and Settings\Tommy\Desktop\classes\Spring03\pic20b\NewsgroupSearcher>more MakeJar.bat
jar -cvmf manifest.txt NewsgroupSearcher.jar *.class
H:\Documents and Settings\Tommy\Desktop\classes\Spring03\pic20b\NewsgroupSearcher>MakeJar.bat
H:\Documents and Settings\Tommy\Desktop\classes\Spring03\pic20b\NewsgroupSearcher>jar -cvmf manifest.txt NewsgroupSearcher.jar *.class
added manifest
adding: NewsgroupSearcher.class(in = 9331) (out= 5115)(deflated 45%)
H:\Documents and Settings\Tommy\Desktop\classes\Spring03\pic20b\NewsgroupSearcher>java -jar NewsgroupSearcher.jar
Exception in thread "main" java.lang.NoClassDefFoundError: gnu/inet/nntp/StatusResponse
thanks,
TT -
How do I run multiple java apps in one JVM to reduce memory use?
Hi all,
I saw an article either on the web or in a magazine not too long ago about how to "detect" if the app is already running, and if so, it hands off the new instance to the already running JVM, which then creates a thread to run the Java app in. As it turns out, my app will be used in an ASP environment, through Citrix. We may have as many as 50 to 100 users running the same app, each with their own unique user ID, but all using the same one server to run it on. Each instance eats up 25MB of memory right now. So the question is if anybody knows of a URL or an app like this that can handle the process of running the same (or even different Java) apps in one JVM as separate threads, instead of requring several instances of the JVM to run? I know this article presented a fully working example, and I believe I know enough to do it but I wanted ot use the article as a reference to make sure it is done right. I know that each app basically would use the same one "launcher" program that would on first launch "listen" to a port, as well as send a message through the port to see if an existing launcher was running. If it does, it hands off the Java app to be run to the existing luancher application and shuts down the 2nd launching app. By using this method, the JVM eats up its normal memory, but each Java app only consumes its necessary memory as well and doesn't use up more JVM instance memory.
Thanks.<pre>
import java.util.Properties;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.Enumeration;
import java.util.NoSuchElementException;
public class RunProg implements Runnable, Cloneable
private String iProg;
private String iArgs[];
public static void main(String args[])
new RunProg().main();
// first step is to start main program itself
private void main()
Properties properties = System.getProperties();
try
properties.load(new FileInputStream("RunProg.properties"));
catch(IOException e)
System.setProperties(properties);
int i = 0;
System.out.println("enter main, activeCount=" + Thread.activeCount());
while(true)
String program = properties.getProperty("Prog" + i);
if(program == null)
break;
StringTokenizer st = new StringTokenizer(program);
String[] args = new String[st.countTokens() - 1];
try
RunProg rp = (RunProg)this.clone();
rp.iProg = st.nextToken();
for(int j = 0; st.hasMoreTokens(); j++)
args[j] = st.nextToken();
rp.iArgs = args;
Thread th = new Thread(rp);
th.setName("prog" + i + "=" + program);
th.start();
System.out.println("prog" + i + "=" + program + ", started");
catch(CloneNotSupportedException e)
System.out.println("prog" + i + "=" + program + ", can't start");
i++;
System.out.println("end of main, activeCount=" + Thread.activeCount());
// next step is to start all others one by one
public void run()
try
Class c = Class.forName(iProg);
Class p[] = new Class[1];
p[0] = String[].class;
Method m = c.getMethod("main", p);
Object o[] = new Object[1];
o[0] = iArgs;
m.invoke(null, o);
catch(ClassNotFoundException e)
System.out.println(iProg + "ClassNotFoundException");
catch(NoSuchMethodException e)
System.out.println(iProg + "NoSuchMethodException");
catch(InvocationTargetException e)
System.out.println(iProg + "NoSuchMethodException");
catch(IllegalAccessException e)
System.out.println(iProg + "NoSuchMethodException");
System.out.println(Thread.currentThread().getName() + ", ended");
System.out.println("exit run, activeCount=" + Thread.activeCount());
// setup SecurityManager to disable method System.exit()
public RunProg()
SecurityManager sm = new mySecurityManager();
System.setSecurityManager(sm);
// inner-class to disable method System.exit()
protected class mySecurityManager extends SecurityManager
public void checkExit(int status)
super.checkExit(status);
Thread.currentThread().stop();
throw new SecurityException();
* inner-class to analyze StringTokenizer. This class is enhanced to check double Quotation marks
protected class StringTokenizer implements Enumeration
private int currentPosition;
private int maxPosition;
private String str;
private String delimiters;
private boolean retTokens;
* Constructs a string tokenizer for the specified string. All
* characters in the <code>delim</code> argument are the delimiters
* for separating tokens.
* <p>
* If the <code>returnTokens</code> flag is <code>true</code>, then
* the delimiter characters are also returned as tokens. Each
* delimiter is returned as a string of length one. If the flag is
* <code>false</code>, the delimiter characters are skipped and only
* serve as separators between tokens.
* @param str a string to be parsed.
* @param delim the delimiters.
* @param returnTokens flag indicating whether to return the delimiters
* as tokens.
public StringTokenizer(String str, String delim, boolean returnTokens)
currentPosition = 0;
this.str = str;
maxPosition = str.length();
delimiters = delim;
retTokens = returnTokens;
* Constructs a string tokenizer for the specified string. The
* characters in the <code>delim</code> argument are the delimiters
* for separating tokens. Delimiter characters themselves will not
* be treated as tokens.
* @param str a string to be parsed.
* @param delim the delimiters.
public StringTokenizer(String str, String delim)
this(str, delim, false);
* Constructs a string tokenizer for the specified string. The
* tokenizer uses the default delimiter set, which is
* <code>"\t\n\r\f"</code>: the space character, the tab
* character, the newline character, the carriage-return character,
* and the form-feed character. Delimiter characters themselves will
* not be treated as tokens.
* @param str a string to be parsed.
public StringTokenizer(String str)
this(str, " \t\n\r\f", false);
* Skips delimiters.
protected void skipDelimiters()
while(!retTokens &&
(currentPosition < maxPosition) &&
(delimiters.indexOf(str.charAt(currentPosition)) >= 0))
currentPosition++;
* Tests if there are more tokens available from this tokenizer's string.
* If this method returns <tt>true</tt>, then a subsequent call to
* <tt>nextToken</tt> with no argument will successfully return a token.
* @return <code>true</code> if and only if there is at least one token
* in the string after the current position; <code>false</code>
* otherwise.
public boolean hasMoreTokens()
skipDelimiters();
return(currentPosition < maxPosition);
* Returns the next token from this string tokenizer.
* @return the next token from this string tokenizer.
* @exception NoSuchElementException if there are no more tokens in this
* tokenizer's string.
public String nextToken()
skipDelimiters();
if(currentPosition >= maxPosition)
throw new NoSuchElementException();
int start = currentPosition;
boolean inQuotation = false;
while((currentPosition < maxPosition) &&
(delimiters.indexOf(str.charAt(currentPosition)) < 0 || inQuotation))
if(str.charAt(currentPosition) == '"')
inQuotation = !inQuotation;
currentPosition++;
if(retTokens && (start == currentPosition) &&
(delimiters.indexOf(str.charAt(currentPosition)) >= 0))
currentPosition++;
String s = str.substring(start, currentPosition);
if(s.charAt(0) == '"')
s = s.substring(1);
if(s.charAt(s.length() - 1) == '"')
s = s.substring(0, s.length() - 1);
return s;
* Returns the next token in this string tokenizer's string. First,
* the set of characters considered to be delimiters by this
* <tt>StringTokenizer</tt> object is changed to be the characters in
* the string <tt>delim</tt>. Then the next token in the string
* after the current position is returned. The current position is
* advanced beyond the recognized token. The new delimiter set
* remains the default after this call.
* @param delim the new delimiters.
* @return the next token, after switching to the new delimiter set.
* @exception NoSuchElementException if there are no more tokens in this
* tokenizer's string.
public String nextToken(String delim)
delimiters = delim;
return nextToken();
* Returns the same value as the <code>hasMoreTokens</code>
* method. It exists so that this class can implement the
* <code>Enumeration</code> interface.
* @return <code>true</code> if there are more tokens;
* <code>false</code> otherwise.
* @see java.util.Enumeration
* @see java.util.StringTokenizer#hasMoreTokens()
public boolean hasMoreElements()
return hasMoreTokens();
* Returns the same value as the <code>nextToken</code> method,
* except that its declared return value is <code>Object</code> rather than
* <code>String</code>. It exists so that this class can implement the
* <code>Enumeration</code> interface.
* @return the next token in the string.
* @exception NoSuchElementException if there are no more tokens in this
* tokenizer's string.
* @see java.util.Enumeration
* @see java.util.StringTokenizer#nextToken()
public Object nextElement()
return nextToken();
* Calculates the number of times that this tokenizer's
* <code>nextToken</code> method can be called before it generates an
* exception. The current position is not advanced.
* @return the number of tokens remaining in the string using the current
* delimiter set.
* @see java.util.StringTokenizer#nextToken()
public int countTokens()
int count = 0;
int currpos = currentPosition;
while(currpos < maxPosition)
* This is just skipDelimiters(); but it does not affect
* currentPosition.
while(!retTokens &&
(currpos < maxPosition) &&
(delimiters.indexOf(str.charAt(currpos)) >= 0))
currpos++;
if(currpos >= maxPosition)
break;
int start = currpos;
boolean inQuotation = false;
while((currpos < maxPosition) &&
(delimiters.indexOf(str.charAt(currpos)) < 0 || inQuotation))
if(str.charAt(currpos) == '"')
inQuotation = !inQuotation;
currpos++;
if(retTokens && (start == currpos) &&
(delimiters.indexOf(str.charAt(currpos)) >= 0))
currpos++;
count++;
return count;
</pre>
RunProg.properties like this:
Prog1=GetEnv 47838 837489 892374 839274
Prog0=GetEnv "djkfds dfkljsd" dsklfj -
Proper way to exit with a j2ee java app running in the NW70 j2ee engine
Hello,
I am working on migrating an app and it's ear from j2ee 6.20 to 7.0. It deploys okay, but when invoked, the j2ee server restarts. Looking at the part that fails, its trying to create a jco connection, which fails and then it catches the failure and does a stack dump and a System.exit(1). It shuts down and restarts at that point. Is System.exit(1) the proper way to exit a java app that is running within the j2ee engine? If it is, is it possible I am picking up the wrong System.exit and need to use an SAP specific one? I inherited the code, but not the IDE it was written with.
Thanks,
Paul D. ChamberlainHi,
Answered my own question. System.exit(1) should not be used. Return works.
Paul D. Chamberlain -
Hi. I want to develop a java application that can be run from a CD... No installation required. The idea is to distribute an application that users will be able to use by just running the java app in a CD. Can this be done? Can this java app in CD run on windows, linux, and mac?
Please help... I am new to java and some sample codes or procedures/steps will be a big help.
Thanks!No the dbf route doesn't have SQL (unless you're willing to pay for propitiatory database drivers), but you read it in row by row and then pull out the columns you want. You could create several dbf files on the CD which would be like different select statements. I only mention this because .dbf is probably easier than an embedded database. Take a look at the API. (I highly suggest going this route if possible it will simply development) .dbf files are just a spec, so they would work on linux.
http://www.svcon.com/jdbf/docs/index.html
If you feel you really need to be able to create select statements take a look at :
http://www.oracle.com/database/berkeley-db/je/index.html
Message was edited by:
ZimmerS1337 -
I've created a standalone Java app that must run at certain times in the day, can anyone recommend how the best way to do this is, its going to run on a windows box!!
i would suggest you get some scheduler to do this for you. windows comes with one of these (programs > accessories > System Tools > Scheduled Tasks)
Maybe you are looking for
-
Credit Limit - How to Use the Foward button in VKM4
Hi all, I have an enquiry here. In VKM4, we can see that there is a 'Foward' icon where we will be able to foward the respective sales order to an authorize person for approval. After I Foward and Save it, system only prompts me saying the SO has bee
-
Problem with displaying index in RH11
Hi, I'm using RH11 to make Responsive HTML5 output in 4 different help projects, with the Theme2-_Government layout (in Dutch and French). All projects start correctly with the TOC pane open and the whole indexfile displayed. Even my first indexsearc
-
Hyperion Enterprise 6.5.1.0 on Microsoft Window 8 (64bits) Laptop
I use Hyperion Enterprise 6.5.1.0 only on my Laptop and i want to install Enterprise on the latest Windows 8.1 - 64bits. Do you know which pack must be intalled to run in 64bits? Is tehere any trap during the intallation? Thank you
-
I am unable to export images from Aperture without crashing the app.
Having just upgraded to Mavericks and the current version of Aperture, I am unable to export images or videos without Aperture crashing. I'm reinstalled Aperture and done a fresh reinstall of Mavericks with no change in condition. Any suggestions?
-
Problem with ONlocation CS 5.5
I have been using Adobe production premium CS5 and now CS5.5 for 1.5 years - on of the best features is th e workflow with story thru onlocation to premiere althought I am finding onlocation not to be a stable program somertimes.